Struct efficient_enum::option::EfficientOptionInnerSome
[−]
[src]
pub struct EfficientOptionInnerSome<'a, A: 'a, B: 'a, TM: 'a = TagMSB>(_)
where
A: TaggableValue<TM, One>;
A helper type for EfficientOption
, useful for accessing 'is_some' data and removing it.
Methods
impl<'a, TM, A, B> EfficientOptionInnerSome<'a, A, B, TM> where
A: TaggableValue<TM, One>,
[src]
A: TaggableValue<TM, One>,
fn clone_0(&self) -> A where
A: Clone,
A: Clone,
Clones the A
value
fn clone_1(&self) -> B where
B: Clone,
B: Clone,
Clones the B
value
fn ref_0(&self) -> &A
Gets a reference to the A
value
fn ref_1(&self) -> &B
Gets a reference to the B
value
fn as_ref(&self) -> (&A, &B)
Gets a reference to both the A
and B
values
fn mut_1(&mut self) -> &mut B
Gets mutable a reference to the B
value
fn as_mut(&mut self) -> (&A, &mut B)
Gets a reference to the A
value and a mutable reference to the B
value
fn destructure_0(self) -> &'a A
Destructures an EfficientOptionInnerSome
into a reference to the A
value
fn destructure_1(self) -> &'a mut B
Destructures an EfficientOptionInnerSome
into a mutable reference to the B
value
fn destructure(self) -> (&'a A, &'a mut B)
Destructures an EfficientOptionInnerSome
fn replace_0(&mut self, a: A) -> A
Replaces the A
value
fn replace_1(&mut self, b: B) -> B
Replaces the B
value
fn take(self) -> (EfficientOptionInnerNone<'a, A, B, TM>, (A, B))
Takes both values out of the option, leaving a None in its place.
fn take_0(self) -> (EfficientOptionInnerNone<'a, A, B, TM>, A)
Takes both values out of the option, leaving a None in its place.
The version only returns the A
value
fn take_1(self) -> (EfficientOptionInnerNone<'a, A, B, TM>, B)
Takes both values out of the option, leaving a None in its place.
The version only returns the B
value
fn map<R, F: FnOnce(&mut A) -> R>(&mut self, f: F) -> R
Maps the value to a result