Home
last modified time | relevance | path

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

123

/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()
113 error.downcast_ref::<LargeAlignedError>().unwrap().0 in test_large_alignment()
120 assert!(error.downcast_ref::<&str>().is_none()); in test_unsuccessful_downcast()
Dtest_context.rs101 assert!(err.downcast_ref::<String>().is_none()); in test_downcast_ref()
104 let high = err.downcast_ref::<HighLevel>().unwrap(); in test_downcast_ref()
108 let mid = err.downcast_ref::<MidLevel>().unwrap(); in test_downcast_ref()
112 let low = err.downcast_ref::<LowLevel>().unwrap(); in test_downcast_ref()
Dtest_boxed.rs25 .downcast_ref::<Box<dyn StdError + Send + Sync>>() in test_boxed_str()
/external/rust/crates/protobuf-json-mapping/src/
Dprint.rs433 if let Some(duration) = message.downcast_ref::<Duration>() { in print_message()
435 } else if let Some(timestamp) = message.downcast_ref::<Timestamp>() { in print_message()
437 } else if let Some(field_mask) = message.downcast_ref::<FieldMask>() { in print_message()
439 } else if let Some(any) = message.downcast_ref::<Any>() { in print_message()
441 } else if let Some(value) = message.downcast_ref::<Value>() { in print_message()
443 } else if let Some(value) = message.downcast_ref::<DoubleValue>() { in print_message()
445 } else if let Some(value) = message.downcast_ref::<FloatValue>() { in print_message()
447 } else if let Some(value) = message.downcast_ref::<Int64Value>() { in print_message()
449 } else if let Some(value) = message.downcast_ref::<UInt64Value>() { in print_message()
451 } else if let Some(value) = message.downcast_ref::<Int32Value>() { in print_message()
[all …]
/external/rust/crates/tracing-core/src/
Dsubscriber.rs507 self.downcast_ref::<T>().is_some() in is()
512 pub fn downcast_ref<T: Any>(&self) -> Option<&T> { in downcast_ref() method
527 self.downcast_ref::<T>().is_some() in is()
532 pub fn downcast_ref<T: Any>(&self) -> Option<&T> { in downcast_ref() method
547 self.downcast_ref::<T>().is_some() in is()
552 pub fn downcast_ref<T: Any>(&self) -> Option<&T> { in downcast_ref() method
567 self.downcast_ref::<T>().is_some() in is()
572 pub fn downcast_ref<T: Any>(&self) -> Option<&T> { in downcast_ref() method
Ddispatcher.rs700 pub fn downcast_ref<T: Any>(&self) -> Option<&T> { in downcast_ref() method
701 <dyn Subscriber>::downcast_ref(&self.subscriber) in downcast_ref()
865 assert!(dispatcher.downcast_ref::<NoSubscriber>().is_some()); in dispatch_downcasts()
/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.rs30 error.source().unwrap().downcast_ref::<io::Error>().unwrap(); in test_implicit_source()
40 error.source().unwrap().downcast_ref::<io::Error>().unwrap(); in test_explicit_source()
47 error.source().unwrap().downcast_ref::<io::Error>().unwrap(); in test_boxed_source()
Dtest_transparent.rs27 error.source().unwrap().downcast_ref::<io::Error>().unwrap(); in test_transparent_struct()
/external/rust/crates/protobuf/2.27.1/src/reflect/
Doptional.rs18 match value.as_any().downcast_ref::<V>() { in set_value()
31 match value.as_any().downcast_ref::<V>() { in set_value()
44 match value.as_any().downcast_ref::<V>() { in set_value()
/external/rust/crates/protobuf/src/reflect/message/
Dgenerated.rs46 let m: &M = message.downcast_ref().expect("wrong message type"); in clone()
51 let a: &M = a.downcast_ref().expect("wrong message type"); in eq()
52 let b: &M = b.downcast_ref().expect("wrong message type"); in eq()
/external/rust/crates/vulkano/src/
Dtests.rs82 if let Some(msg) = err.downcast_ref::<String>() {
84 } else if let Some(&msg) = err.downcast_ref::<&str>() {
/external/rust/crates/protobuf/src/
Dmessage_dyn.rs218 pub fn downcast_ref<'a, M: MessageFull + 'a>(&'a self) -> Option<&'a M> { in downcast_ref() method
272 fn downcast_ref() { in downcast_ref() function
275 let c: &FileDescriptorProto = d.downcast_ref().unwrap(); in downcast_ref()
/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/rayon-core/src/spawn/
Dtest.rs35 if let Some(&msg) = err.downcast_ref::<&str>() { in panic_fwd()
107 if let Some(&msg) = error.downcast_ref::<&str>() { in custom_panic_handler_and_spawn()
143 if let Some(&msg) = error.downcast_ref::<&str>() { in custom_panic_handler_and_nested_spawn()
/external/rust/crates/clap/3.2.23/src/parser/matches/
Dany_value.rs16 pub(crate) fn downcast_ref<T: std::any::Any + Clone + Send + Sync + 'static>( in downcast_ref() method
19 self.inner.downcast_ref::<T>() in downcast_ref()
Darg_matches.rs1237 .downcast_ref::<T>() in try_get_one()
1256 iter: values.map(|v| v.downcast_ref::<T>().expect(INTERNAL_ERROR_MSG)), in try_get_many()
1840 match value.downcast_ref::<String>() { in unwrap_string()
1851 match value.downcast_ref::<String>() { in unwrap_string_arg()
1865 match value.downcast_ref::<OsString>() { in unwrap_os_string()
1876 match value.downcast_ref::<OsString>() { in unwrap_os_string_arg()
/external/rust/crates/clap/src/parser/matches/
Dany_value.rs16 pub(crate) fn downcast_ref<T: std::any::Any + Clone + Send + Sync + 'static>( in downcast_ref() method
19 self.inner.downcast_ref::<T>() in downcast_ref()
/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/protobuf/src/reflect/field/
Ddynamic.rs15 DynamicMessage::downcast_ref(message).get_reflect(&self.field) in get_reflect()
/external/rust/crates/libtest-mimic/src/
Dlib.rs504 let payload = e.downcast_ref::<String>() in run_single()
506 .or(e.downcast_ref::<&str>().map(|s| *s)); in run_single()
/external/rust/crates/quickcheck/src/
Dtester.rs405 if let Some(&s) = any_err.downcast_ref::<&str>() { in safe()
407 } else if let Some(s) = any_err.downcast_ref::<String>() { in safe()
/external/rust/crates/rayon/src/iter/collect/
Dtest.rs355 let message_str = error.downcast_ref::<&'static str>().cloned(); in assert_is_panic_with_message()
356 let message_string = error.downcast_ref::<String>().map(String::as_str); in assert_is_panic_with_message()
/external/rust/crates/protobuf/src/reflect/acc/v2/
Dmap.rs50 let m = m.downcast_ref().unwrap(); in get_reflect()

123