[−][src]Struct futures_locks::MutexWeak
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 + Send> Send for MutexWeak<T>[src]
impl<T: ?Sized + Send> Sync for MutexWeak<T>[src]
impl<T: ?Sized> Clone for MutexWeak<T>[src]
impl<T: Debug + ?Sized> Debug for MutexWeak<T>[src]
Auto Trait Implementations
impl<T: ?Sized> Unpin for MutexWeak<T>
impl<T> !UnwindSafe for MutexWeak<T>
impl<T> !RefUnwindSafe for MutexWeak<T>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,