pub trait EnumerableMut<'a, EnumMut> {
// Required method
fn as_enum_mut(&'a mut self) -> EnumMut;
}Expand description
A type that can lend itself mutably to the borrowing enum of its sealed trait.
The counterpart of EnumerableRef, reached from a &mut S the same way:
struct Square;
#[enumerate]
#[sealed(Square)]
trait Shape {}
impl Shape for Square {}
let mut s = &mut Square;
match s.as_enum_mut() {
AnyShapeMut::Square(s) => { /* .. */ }
}Unlike the shared enum this one is neither Clone nor Copy, a unique reference being neither.
Required Methods§
Sourcefn as_enum_mut(&'a mut self) -> EnumMut
fn as_enum_mut(&'a mut self) -> EnumMut
Wraps &mut self in the variant of EnumMut that holds this type.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".