Skip to main content

TokenMapMut

Struct TokenMapMut 

Source
pub struct TokenMapMut<'a, T: ?Sized, U, F: FnOnce(TokenGuardMut<'a, T, Token>) -> U, Cell: ?Sized, Token: TokenTrait<ComparisonMaySpuriouslyEq = ComparisonMaySpuriouslyEq> + 'a, ComparisonMaySpuriouslyEq> { /* private fields */ }
Expand description

An operation waiting to be applied onto a cell by providing a proof of mutable access.

Implementations§

Source§

impl<'a, T: ?Sized, U, F: FnOnce(TokenGuardMut<'a, T, Token>) -> U, Token: TokenTrait<ComparisonMaySpuriouslyEq = False>, Cell: TokenCellTrait<T, Token>> TokenMapMut<'a, T, U, F, Cell, Token, False>

Source

pub fn try_apply( self, token: &'a mut Token, ) -> Result<U, Token::ComparisonError>

Attempt to apply the operation.

§Errors

If the token comparison failed. Reaching this error is likely to be a fundamental error in your program.

Source

pub fn apply(self, token: &'a mut Token) -> U
where Token: TokenTrait<ComparisonError = Infallible>,

Applies the operation.

Source§

impl<'a, T: ?Sized, U, F: FnOnce(TokenGuardMut<'a, T, Token>) -> U, Token: TokenTrait<ComparisonMaySpuriouslyEq = True>, Cell: UnsafeTokenCellTrait<T, Token>> TokenMapMut<'a, T, U, F, Cell, Token, True>

Source

pub unsafe fn try_apply( self, token: &'a mut Token, ) -> Result<U, Token::ComparisonError>

Attempt to apply the operation.

§Errors

If the token comparison failed. Reaching this error is likely to be a fundamental error in your program.

§Safety

token must refer to the exact same instance of Token as that which was used to call [Self::new].

Source

pub unsafe fn apply(self, token: &'a mut Token) -> U
where Token: TokenTrait<ComparisonError = Infallible>,

Applies the operation.

§Safety

token must refer to the exact same instance of Token as that which was used to call [Self::new].

Auto Trait Implementations§

§

impl<'a, T, U, F, Cell, Token, ComparisonMaySpuriouslyEq> Freeze for TokenMapMut<'a, T, U, F, Cell, Token, ComparisonMaySpuriouslyEq>
where &'a Cell: Freeze, F: Freeze, PhantomData<(&'a T, U, Token, ComparisonMaySpuriouslyEq)>: Freeze, T: ?Sized, Cell: ?Sized,

§

impl<'a, T, U, F, Cell, Token, ComparisonMaySpuriouslyEq> RefUnwindSafe for TokenMapMut<'a, T, U, F, Cell, Token, ComparisonMaySpuriouslyEq>
where &'a Cell: RefUnwindSafe, F: RefUnwindSafe, PhantomData<(&'a T, U, Token, ComparisonMaySpuriouslyEq)>: RefUnwindSafe, T: ?Sized, Cell: ?Sized,

§

impl<'a, T, U, F, Cell, Token, ComparisonMaySpuriouslyEq> Send for TokenMapMut<'a, T, U, F, Cell, Token, ComparisonMaySpuriouslyEq>
where &'a Cell: Send, F: Send, PhantomData<(&'a T, U, Token, ComparisonMaySpuriouslyEq)>: Send, T: ?Sized, Cell: ?Sized,

§

impl<'a, T, U, F, Cell, Token, ComparisonMaySpuriouslyEq> Sync for TokenMapMut<'a, T, U, F, Cell, Token, ComparisonMaySpuriouslyEq>
where &'a Cell: Sync, F: Sync, PhantomData<(&'a T, U, Token, ComparisonMaySpuriouslyEq)>: Sync, T: ?Sized, Cell: ?Sized,

§

impl<'a, T, U, F, Cell, Token, ComparisonMaySpuriouslyEq> Unpin for TokenMapMut<'a, T, U, F, Cell, Token, ComparisonMaySpuriouslyEq>
where &'a Cell: Unpin, F: Unpin, PhantomData<(&'a T, U, Token, ComparisonMaySpuriouslyEq)>: Unpin, T: ?Sized, Cell: ?Sized,

§

impl<'a, T, U, F, Cell, Token, ComparisonMaySpuriouslyEq> UnsafeUnpin for TokenMapMut<'a, T, U, F, Cell, Token, ComparisonMaySpuriouslyEq>
where &'a Cell: UnsafeUnpin, F: UnsafeUnpin, PhantomData<(&'a T, U, Token, ComparisonMaySpuriouslyEq)>: UnsafeUnpin, T: ?Sized, Cell: ?Sized,

§

impl<'a, T, U, F, Cell, Token, ComparisonMaySpuriouslyEq> UnwindSafe for TokenMapMut<'a, T, U, F, Cell, Token, ComparisonMaySpuriouslyEq>
where &'a Cell: UnwindSafe, F: UnwindSafe, PhantomData<(&'a T, U, Token, ComparisonMaySpuriouslyEq)>: UnwindSafe, T: ?Sized, Cell: ?Sized,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.