Trait safecast::AsType [−][src]
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
fn as_type_mut(&mut self) -> Option<&mut T>
fn as_type_mut(&mut self) -> Option<&mut T>
Borrow this instance mutably as an instance of T
if possible.