Skip to main content

GuardedMut

Trait GuardedMut 

Source
pub trait GuardedMut<T>
where T: ?Sized,
{ type GuardMut<'a>: DerefMut<Target = T> where Self: 'a; // Required method fn get_mut<'a>(&'a self) -> Self::GuardMut<'a>; }

Required Associated Types§

Source

type GuardMut<'a>: DerefMut<Target = T> where Self: 'a

Required Methods§

Source

fn get_mut<'a>(&'a self) -> Self::GuardMut<'a>

Can panic on exceptional behavior (ex poisoned mutex)

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> GuardedMut<T> for RefCell<T>

Available on crate feature std only.
Source§

type GuardMut<'a> = RefMut<'a, T> where RefCell<T>: 'a

Source§

fn get_mut<'a>(&'a self) -> <RefCell<T> as GuardedMut<T>>::GuardMut<'a>

Source§

impl<T> GuardedMut<T> for Mutex<T>

Available on crate feature std only.
Source§

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

Source§

fn get_mut<'a>(&'a self) -> <Mutex<T> as GuardedMut<T>>::GuardMut<'a>

Source§

impl<T> GuardedMut<T> for RwLock<T>

Available on crate feature std only.
Source§

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

Source§

fn get_mut<'a>(&'a self) -> <RwLock<T> as GuardedMut<T>>::GuardMut<'a>

Implementors§