pub trait DowncastFrom<T>: Sized {
    // Required method
    fn downcast_from(t: &T) -> Option<Self>;
}
Expand description

Our version of “try-from”. A “downcast” casts from a more general type (e.g., any Parameter) to a more specific type (e.g., a type). This returns an Option because the value may not be an instance of the more specific type.

Required Methods§

source

fn downcast_from(t: &T) -> Option<Self>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<A, B, A1, B1> DowncastFrom<(A1, B1)> for (A, B)
where A: DowncastFrom<A1>, B: DowncastFrom<B1>,

source§

impl<A, B, C, A1, B1, C1> DowncastFrom<(A1, B1, C1)> for (A, B, C)
where A: DowncastFrom<A1>, B: DowncastFrom<B1>, C: DowncastFrom<C1>,

source§

impl<T, U> DowncastFrom<Option<U>> for Option<T>
where T: DowncastFrom<U>,

source§

fn downcast_from(u: &Option<U>) -> Option<Self>

source§

impl<T, U> DowncastFrom<Arc<U>> for Arc<T>
where T: DowncastFrom<U>,

source§

fn downcast_from(u: &Arc<U>) -> Option<Self>

Implementors§

source§

impl<A, B> DowncastFrom<BTreeSet<A>> for Set<B>
where A: Ord, B: DowncastFrom<A> + Ord,

source§

impl<T, U> DowncastFrom<T> for U
where T: DowncastTo<U>,