Searched refs:downcast_ref (Results 1 – 20 of 20) sorted by relevance
37 *bail_literal().unwrap_err().downcast_ref::<&str>().unwrap(), in test_downcast_ref()41 bail_fmt().unwrap_err().downcast_ref::<String>().unwrap(), in test_downcast_ref()47 .downcast_ref::<io::Error>() in test_downcast_ref()74 assert_eq!(bailed.downcast_ref::<String>().unwrap(), "clobber"); in test_downcast_mut()104 error.downcast_ref::<LargeAlignedError>().unwrap().0 in test_large_alignment()111 assert!(error.downcast_ref::<&str>().is_none()); in test_unsuccessful_downcast()
95 assert!(err.downcast_ref::<String>().is_none()); in test_downcast_ref()98 let high = err.downcast_ref::<HighLevel>().unwrap(); in test_downcast_ref()102 let mid = err.downcast_ref::<MidLevel>().unwrap(); in test_downcast_ref()106 let low = err.downcast_ref::<LowLevel>().unwrap(); in test_downcast_ref()
20 .downcast_ref::<Box<dyn StdError + Send + Sync>>() in test_boxed_str()
19 match value.as_any().downcast_ref::<V>() { in set_value()32 match value.as_any().downcast_ref::<V>() { in set_value()45 match value.as_any().downcast_ref::<V>() { in set_value()
106 .downcast_ref::<Vec<Box<dyn Any + Send + 'static>>>() in panic_twice()110 let first = vec[0].downcast_ref::<&str>().unwrap(); in panic_twice()111 let second = vec[1].downcast_ref::<&str>().unwrap(); in panic_twice()128 .downcast_ref::<Vec<Box<dyn Any + Send + 'static>>>() in panic_many()133 let panic = panic.downcast_ref::<&str>().unwrap(); in panic_many()
32 error.source().unwrap().downcast_ref::<io::Error>().unwrap(); in test_implicit_source()42 error.source().unwrap().downcast_ref::<io::Error>().unwrap(); in test_explicit_source()49 error.source().unwrap().downcast_ref::<io::Error>().unwrap(); in test_boxed_source()
29 error.source().unwrap().downcast_ref::<io::Error>().unwrap(); in test_transparent_struct()
32 if let Some(&msg) = err.downcast_ref::<&str>() { in panic_fwd()102 if let Some(&msg) = error.downcast_ref::<&str>() { in custom_panic_handler_and_spawn()137 if let Some(&msg) = error.downcast_ref::<&str>() { in custom_panic_handler_and_nested_spawn()
96 if let Some(foo) = base.downcast_ref::<Foo>() {98 } else if let Some(bar) = base.downcast_ref::<Bar>() {145 if let Some(foo) = base.downcast_ref::<Foo>() {147 } else if let Some(bar) = base.downcast_ref::<Bar>() {
281 … pub fn downcast_ref<__T: $trait_<$($types)*>>(&self) -> $crate::__std::option::Option<&__T> {282 $crate::Downcast::as_any(self).downcast_ref::<__T>()518 match base.downcast_ref::<Foo>() {533 if let Some(foo) = base.downcast_ref::<Foo>() {535 } else if let Some(bar) = base.downcast_ref::<Bar>() {
90 if let Some(e) = self.inner.downcast_ref::<std::io::Error>() { in raw_os_error()109 self.inner.downcast_ref::<ErrorCode>().map(|c| c.0) in code()
263 pub fn downcast_ref<T: 'static>(&self) -> Option<&T> { in downcast_ref() method264 self.inner.downcast_ref::<T>() in downcast_ref()653 assert_eq!(42u64, v.downcast_ref::<Foo>().expect("invalid downcast").0); in test_downcast_ref()
367 let message_str = error.downcast_ref::<&'static str>().cloned(); in assert_is_panic_with_message()368 let message_string = error.downcast_ref::<String>().map(String::as_str); in assert_is_panic_with_message()
132 let err: &'static str = err.downcast_ref::<&'static str>().unwrap(); in useful_panic_message_when_dropping_rt_in_rt()
33 .downcast_ref() in add_vcpu()
308 .downcast_ref() in add_vcpu()470 .downcast_ref() in inject_interrupts()
260 m.as_any().downcast_ref::<M>().unwrap() in message_down_cast()
403 self.downcast_ref::<E>().is_some() in is()477 pub fn downcast_ref<E>(&self) -> Option<&E> in downcast_ref() method
79 let message = box_any.downcast_ref::<String>().unwrap(); in lifetime_invalid()
72 match root_cause.downcast_ref::<DataStoreError>() {