pub struct MutGuard<T> { /* private fields */ }Expand description
stores an inner element that must implement the Guard trait,
and forbids mutable borrows except going through its guard() method.
Implementations§
Source§impl<T: Guard> MutGuard<T>
impl<T: Guard> MutGuard<T>
pub fn new(inner: T) -> MutGuard<T>
Sourcepub fn guard(&mut self) -> MutGuardBorrow<'_, T>
pub fn guard(&mut self) -> MutGuardBorrow<'_, T>
call this method to get mutable access to the underlying element
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
returns the wrapped element, consuming the MutGuard
Source§impl<'a, T> MutGuard<MutGuardWrapper<'a, T>>
impl<'a, T> MutGuard<MutGuardWrapper<'a, T>>
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for MutGuard<T>where
T: Freeze,
impl<T> RefUnwindSafe for MutGuard<T>where
T: RefUnwindSafe,
impl<T> Send for MutGuard<T>where
T: Send,
impl<T> Sync for MutGuard<T>where
T: Sync,
impl<T> Unpin for MutGuard<T>where
T: Unpin,
impl<T> UnwindSafe for MutGuard<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more