[−][src]Struct futures_locks_pre::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> 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]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,