pub struct MappedMut<T, U>where
T: GuardedMut,
U: ?Sized,{ /* private fields */ }
Expand description
A mapped guard, which contains a guarded owned pointer, and a mutable reference to that
pointer. It has had a one-time closure applied to it, but only the output of the closure is
stored, not the closure itself. This is similar to how crates like owning_ref
work.
Implementations§
Source§impl<T, U> MappedMut<T, U>where
T: GuardedMut,
U: ?Sized,
impl<T, U> MappedMut<T, U>where
T: GuardedMut,
U: ?Sized,
Sourcepub fn into_original(self) -> T
pub fn into_original(self) -> T
Move out the original pointer from the mapped guard, hence cancelling the temporary borrow.
Sourcepub fn into_immutable(this: MappedMut<T, U>) -> Mapped<T, U>
pub fn into_immutable(this: MappedMut<T, U>) -> Mapped<T, U>
Convert MappedMut<T, U>
to Mapped<T, U>
.
Trait Implementations§
Source§impl<T, U> Guarded for MappedMut<T, U>where
T: GuardedMut,
U: ?Sized,
impl<T, U> Guarded for MappedMut<T, U>where
T: GuardedMut,
U: ?Sized,
Source§type Target = U
type Target = U
The target pointee that this pointer may dereference into. There are no real restrictions
to what this type can be. However, the user must not assume that simply because a
&Target
reference is protected, that references indirectly derived (via Deref
and other traits)
would also be protected.Source§fn borrow_guarded(&self) -> &Self::Target
fn borrow_guarded(&self) -> &Self::Target
Borrow the pointee, into a fixed reference that can be sent directly and safely to e.g.
memory-sharing completion-based I/O interfaces. Read more
Source§impl<T, U> GuardedMut for MappedMut<T, U>where
T: GuardedMut,
U: ?Sized,
impl<T, U> GuardedMut for MappedMut<T, U>where
T: GuardedMut,
U: ?Sized,
Source§fn borrow_guarded_mut(&mut self) -> &mut Self::Target
fn borrow_guarded_mut(&mut self) -> &mut Self::Target
Borrow the pointee mutably, into a fixed reference that can be sent directly and safely to
e.g. memory-sharing completion-based I/O interfaces. Read more
Auto Trait Implementations§
impl<T, U> Freeze for MappedMut<T, U>
impl<T, U> RefUnwindSafe for MappedMut<T, U>
impl<T, U> !Send for MappedMut<T, U>
impl<T, U> !Sync for MappedMut<T, U>
impl<T, U> Unpin for MappedMut<T, U>
impl<T, U> UnwindSafe for MappedMut<T, U>
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