Struct EfficientOptionInnerSome

Source
pub struct EfficientOptionInnerSome<'a, A, B: 'a, TM: 'a = TagMSB>(/* private fields */)
where
    A: TaggableValue<TM, One> + 'a;
Expand description

A helper type for EfficientOption, useful for accessing ‘is_some’ data and removing it.

Implementations§

Source§

impl<'a, TM, A, B> EfficientOptionInnerSome<'a, A, B, TM>
where A: TaggableValue<TM, One>,

Source

pub fn clone_0(&self) -> A
where A: Clone,

Clones the A value

Source

pub fn clone_1(&self) -> B
where B: Clone,

Clones the B value

Source

pub fn ref_0(&self) -> &A

Gets a reference to the A value

Source

pub fn ref_1(&self) -> &B

Gets a reference to the B value

Source

pub fn as_ref(&self) -> (&A, &B)

Gets a reference to both the A and B values

Source

pub fn mut_1(&mut self) -> &mut B

Gets mutable a reference to the B value

Source

pub fn as_mut(&mut self) -> (&A, &mut B)

Gets a reference to the A value and a mutable reference to the B value

Source

pub fn destructure_0(self) -> &'a A

Destructures an EfficientOptionInnerSome into a reference to the A value

Source

pub fn destructure_1(self) -> &'a mut B

Destructures an EfficientOptionInnerSome into a mutable reference to the B value

Source

pub fn destructure(self) -> (&'a A, &'a mut B)

Destructures an EfficientOptionInnerSome

Source

pub fn replace_0(&mut self, a: A) -> A

Replaces the A value

Source

pub fn replace_1(&mut self, b: B) -> B

Replaces the B value

Source

pub fn take(self) -> (EfficientOptionInnerNone<'a, A, B, TM>, (A, B))

Takes both values out of the option, leaving a None in its place.

Source

pub 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

Source

pub 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

Source

pub fn map<R, F: FnOnce(&mut A) -> R>(&mut self, f: F) -> R

Maps the value to a result

Auto Trait Implementations§

§

impl<'a, A, B, TM> Freeze for EfficientOptionInnerSome<'a, A, B, TM>

§

impl<'a, A, B, TM> RefUnwindSafe for EfficientOptionInnerSome<'a, A, B, TM>

§

impl<'a, A, B, TM> Send for EfficientOptionInnerSome<'a, A, B, TM>
where B: Send, A: Send, TM: Send,

§

impl<'a, A, B, TM> Sync for EfficientOptionInnerSome<'a, A, B, TM>
where B: Sync, A: Sync, TM: Sync,

§

impl<'a, A, B, TM> Unpin for EfficientOptionInnerSome<'a, A, B, TM>

§

impl<'a, A, B, TM = TagMSB> !UnwindSafe for EfficientOptionInnerSome<'a, A, B, TM>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.