pub enum MutabilityEnum<M: Mutability> {
Mutable(IsMutable<M>),
Shared(IsShared<M>),
}Expand description
This enum makes it possible to match over a mutability parameter.
Not to be confused with the Mutability trait, which is used as a bound for mutability parameters; and Shared and Mutable, which are values of the mutability parameters.
A value of this type can be obtained from the Mutability::mutability() method.
Each variant contains a proof about the value of mutability parameter M.
Note that the only valid value of type MutabilityEnum<Shared> is MutabilityEnum::Shared(IsShared), and the only value of type MutabilityEnum<Mutable> is MutabilityEnum::Mutable(IsMutable)
Variants§
Mutable(IsMutable<M>)
Contains a proof that M is Mutable. MutabilityEnum::Mutable (this enum variant) is not to be confused with Mutable (type implementing Mutability).
Contains a proof that M is Shared. MutabilityEnum::Shared (this enum variant) is not to be confused with Shared (type implementing Mutability).
Trait Implementations§
Source§impl<M: Clone + Mutability> Clone for MutabilityEnum<M>
impl<M: Clone + Mutability> Clone for MutabilityEnum<M>
Source§fn clone(&self) -> MutabilityEnum<M>
fn clone(&self) -> MutabilityEnum<M>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more