pub enum Mutable {}
Expand description
Represents the mutability of a mutable (unique) reference, &mut T
.
Along with Shared
, this is one of the two types that can be used as a generic mutability parameter.
It is an empty type because it is always used as a generic parameter and never as a value.
Implementations§
Source§impl Mutable
impl Mutable
Sourcepub fn mutability() -> IsMutable<Mutable>
pub fn mutability() -> IsMutable<Mutable>
This method returns a proof for the mutable-ness of Mutable
.
Note: this method shadows <Mutable as Mutability>::mutability()
, which returns the same proof wrapped in MutabilityEnum::Mutable
.
If you have access to this method (i.e. in non-generic contexts), you should not need <Mutable as Mutability>::mutability()
.
Trait Implementations§
Source§impl Mutability for Mutable
impl Mutability for Mutable
Source§fn mutability() -> MutabilityEnum<Self>
fn mutability() -> MutabilityEnum<Self>
The result of this method lets you match over the mutability values to obtain a proof, which can be used to access features that are only available for one mutability. Read more
impl Copy for Mutable
Auto Trait Implementations§
impl Freeze for Mutable
impl RefUnwindSafe for Mutable
impl Send for Mutable
impl Sync for Mutable
impl Unpin for Mutable
impl UnwindSafe for Mutable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more