[][src]Struct tokenlock::TokenLock

pub struct TokenLock<T: ?Sized, I> { /* fields omitted */ }

A mutual exclusive primitive that can be accessed using a Token<I> with a very low over-head.

See the module-level documentation for more details.

Methods

impl<T, I> TokenLock<T, I>[src]

pub fn new(keyhole: I, data: T) -> Self[src]

impl<T: ?Sized, I> TokenLock<T, I>[src]

pub fn keyhole(&self) -> &I[src]

pub fn get_mut(&mut self) -> &mut T[src]

pub fn read<'a, K: Token<I>>(&'a self, token: &'a K) -> Option<&'a T>[src]

pub fn write<'a, K: Token<I>>(&'a self, token: &'a mut K) -> Option<&'a mut T>[src]

Trait Implementations

impl<T: ?Sized, I: Debug> Debug for TokenLock<T, I>[src]

impl<T: ?Sized + Send + Sync, I: Send> Send for TokenLock<T, I>[src]

impl<T: ?Sized + Send + Sync, I: Sync> Sync for TokenLock<T, I>[src]

Auto Trait Implementations

impl<T, I> !RefUnwindSafe for TokenLock<T, I>

impl<T: ?Sized, I> Unpin for TokenLock<T, I> where
    I: Unpin,
    T: Unpin

impl<T: ?Sized, I> UnwindSafe for TokenLock<T, I> where
    I: UnwindSafe,
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.