Skip to main content

TryGuardedMut

Trait TryGuardedMut 

Source
pub trait TryGuardedMut<T>: GuardedMut<T>
where T: ?Sized,
{ type Error<'a>: Debug where Self: 'a; // Required method fn try_get_mut<'a>(&'a self) -> Result<Self::GuardMut<'a>, Self::Error<'a>>; }

Required Associated Types§

Source

type Error<'a>: Debug where Self: 'a

Required Methods§

Source

fn try_get_mut<'a>(&'a self) -> Result<Self::GuardMut<'a>, Self::Error<'a>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> TryGuardedMut<T> for RefCell<T>

Available on crate feature std only.
Source§

type Error<'a> = BorrowMutError where RefCell<T>: 'a

Source§

fn try_get_mut<'a>( &'a self, ) -> Result<<RefCell<T> as GuardedMut<T>>::GuardMut<'a>, <RefCell<T> as TryGuardedMut<T>>::Error<'a>>

Source§

impl<T> TryGuardedMut<T> for Mutex<T>

Available on crate feature std only.
Source§

type Error<'a> = PoisonError<MutexGuard<'a, T>> where Mutex<T>: 'a

Source§

fn try_get_mut<'a>( &'a self, ) -> Result<<Mutex<T> as GuardedMut<T>>::GuardMut<'a>, <Mutex<T> as TryGuardedMut<T>>::Error<'a>>

Source§

impl<T> TryGuardedMut<T> for RwLock<T>

Available on crate feature std only.
Source§

type Error<'a> = PoisonError<RwLockWriteGuard<'a, T>> where RwLock<T>: 'a

Source§

fn try_get_mut<'a>( &'a self, ) -> Result<<RwLock<T> as GuardedMut<T>>::GuardMut<'a>, <RwLock<T> as TryGuardedMut<T>>::Error<'a>>

Implementors§