[][src]Struct tokio_lk::Lock

pub struct Lock<T> where
    Lock<T>: Destruct<T>, 
{ /* fields omitted */ }

Lock future struct

The lock future refers to shared map to support lock-by-id functionality

Methods

impl<T: Clone> Lock<T> where
    Lock<T>: Destruct<T>,
    AsyncInsert<T>: Future<Output = Arc<(AtomicUsize, AtomicUsize, AtomicSerialWaker)>>, 
[src]

pub async fn fnew(target: usize, map: KeyPool<T>) -> Self[src]

Create a Lock instance on the future's result

Trait Implementations

impl<T: Clone> Clone for Lock<T> where
    Lock<T>: Destruct<T>, 
[src]

impl<T: Debug> Debug for Lock<T> where
    Lock<T>: Destruct<T>, 
[src]

impl Destruct<Arc<Mutex<HashMap<usize, Arc<(AtomicUsize, AtomicUsize, AtomicSerialWaker)>, RandomState>>>> for Lock<MapType>[src]

impl<T> Destruct<T> for Lock<T>[src]

impl<T> Drop for Lock<T> where
    Lock<T>: Destruct<T>, 
[src]

impl<T: Clone + Unpin> Future for Lock<T> where
    Lock<T>: Destruct<T>,
    Guard<T>: Destruct<T>, 
[src]

type Output = Guard<T>

The type of value produced on completion.

impl New<Arc<Mutex<HashMap<usize, Arc<(AtomicUsize, AtomicUsize, AtomicSerialWaker)>, RandomState>>>> for Lock<MapType>[src]

fn new(target: usize, map: KeyPool<MapType>) -> Self[src]

Create a Lock instance. This operation might block threads from parking for a while Don't use this function inside tokio context please refer to fnew function to provide asynchrons Lock instance generation

Auto Trait Implementations

impl<T> !RefUnwindSafe for Lock<T>

impl<T> Send for Lock<T> where
    T: Send

impl<T> Sync for Lock<T> where
    T: Sync

impl<T> Unpin for Lock<T> where
    T: Unpin

impl<T> !UnwindSafe for Lock<T>

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> FutureExt for T where
    T: Future + ?Sized
[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.