[][src]Struct futures_locks_pre::MutexWeak

pub struct MutexWeak<T: ?Sized> { /* fields omitted */ }

MutexWeak is a non-owning reference to a Mutex. MutexWeak is to Mutex as std::sync::Weak is to std::sync::Arc.

Examples

let mutex = Mutex::<u32>::new(0);
let mutex_weak = Mutex::downgrade(&mutex);
let mutex_new = mutex_weak.upgrade().unwrap();

Methods

impl<T: ?Sized> MutexWeak<T>[src]

pub fn upgrade(&self) -> Option<Mutex<T>>[src]

Tries to upgrade the MutexWeak to Mutex. If the Mutex was dropped then the function return None.

Trait Implementations

impl<T: ?Sized> Clone for MutexWeak<T>[src]

impl<T: Debug + ?Sized> Debug for MutexWeak<T>[src]

impl<T: ?Sized + Send> Send for MutexWeak<T>[src]

impl<T: ?Sized + Send> Sync for MutexWeak<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for MutexWeak<T>

impl<T: ?Sized> Unpin for MutexWeak<T>

impl<T> !UnwindSafe for MutexWeak<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, 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.