Skip to main content

TryGuarded

Trait TryGuarded 

Source
pub trait TryGuarded<T>: Guarded<T>
where T: ?Sized,
{ type Error<'a>: Debug where Self: 'a; // Required method fn try_get<'a>(&'a self) -> Result<Self::Guard<'a>, Self::Error<'a>>; }

Required Associated Types§

Source

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

Required Methods§

Source

fn try_get<'a>(&'a self) -> Result<Self::Guard<'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> TryGuarded<T> for RefCell<T>

Available on crate feature std only.
Source§

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

Source§

fn try_get<'a>( &'a self, ) -> Result<<RefCell<T> as Guarded<T>>::Guard<'a>, <RefCell<T> as TryGuarded<T>>::Error<'a>>

Source§

impl<T> TryGuarded<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<'a>( &'a self, ) -> Result<<Mutex<T> as Guarded<T>>::Guard<'a>, <Mutex<T> as TryGuarded<T>>::Error<'a>>

Source§

impl<T> TryGuarded<T> for RwLock<T>

Available on crate feature std only.
Source§

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

Source§

fn try_get<'a>( &'a self, ) -> Result<<RwLock<T> as Guarded<T>>::Guard<'a>, <RwLock<T> as TryGuarded<T>>::Error<'a>>

Implementors§