Trait safecast::AsType

source ·
pub trait AsType<T>: From<T> {
    fn as_type(&self) -> Option<&T>;
    fn as_type_mut(&mut self) -> Option<&mut T>;
    fn into_type(self) -> Option<T>;
}
Expand description

Conversion methods from a container type (such as an enum) and a target type T.

Required Methods§

Borrow this instance as an instance of T if possible.

Borrow this instance mutably as an instance of T if possible.

Convert this instance into an instance of T if possible.

Implementors§