pub trait AsType<T>: From<T> {
// Required methods
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§
sourcefn 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.
Object Safety§
This trait is not object safe.