Home
last modified time | relevance | path

Searched refs:downcast_ref (Results 1 – 20 of 20) sorted by relevance

/external/rust/crates/anyhow/tests/
Dtest_downcast.rs37 *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()
Dtest_context.rs95 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()
Dtest_boxed.rs20 .downcast_ref::<Box<dyn StdError + Send + Sync>>() in test_boxed_str()
/external/rust/crates/protobuf/src/reflect/
Doptional.rs19 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()
/external/rust/crates/crossbeam-utils/tests/
Dthread.rs106 .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()
/external/rust/crates/thiserror/tests/
Dtest_source.rs32 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()
Dtest_transparent.rs29 error.source().unwrap().downcast_ref::<io::Error>().unwrap(); in test_transparent_struct()
/external/rust/crates/rayon-core/src/spawn/
Dtest.rs32 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()
/external/rust/crates/downcast-rs/
DREADME.md96 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>() {
/external/rust/crates/downcast-rs/src/
Dlib.rs281 … 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>() {
/external/rust/crates/rand_core/src/
Derror.rs90 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()
/external/rust/crates/log/src/kv/
Dvalue.rs263 pub fn downcast_ref<T: 'static>(&self) -> Option<&T> { in downcast_ref() method
264 self.inner.downcast_ref::<T>() in downcast_ref()
653 assert_eq!(42u64, v.downcast_ref::<Foo>().expect("invalid downcast").0); in test_downcast_ref()
/external/rust/crates/rayon/src/iter/collect/
Dtest.rs367 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()
/external/rust/crates/tokio/tests/
Dtask_blocking.rs132 let err: &'static str = err.downcast_ref::<&'static str>().unwrap(); in useful_panic_message_when_dropping_rt_in_rt()
/external/crosvm/devices/src/irqchip/kvm/
Dmod.rs33 .downcast_ref() in add_vcpu()
Dx86_64.rs308 .downcast_ref() in add_vcpu()
470 .downcast_ref() in inject_interrupts()
/external/rust/crates/protobuf/src/
Dmessage.rs260 m.as_any().downcast_ref::<M>().unwrap() in message_down_cast()
/external/rust/crates/anyhow/src/
Derror.rs403 self.downcast_ref::<E>().is_some() in is()
477 pub fn downcast_ref<E>(&self) -> Option<&E> in downcast_ref() method
/external/rust/crates/proc-macro2/tests/
Dtest.rs79 let message = box_any.downcast_ref::<String>().unwrap(); in lifetime_invalid()
/external/rust/crates/anyhow/
DREADME.md72 match root_cause.downcast_ref::<DataStoreError>() {