pub struct Final<T>(/* private fields */);Expand description
This no-std crate provides the Final, struct which guarantees the interior
immutability of the value that it wraps. This is useful for preserving
invariants on the fields of structures, whose ‘safe’ mutation would cause
undefined behavior.
Wraps a value in the Final type, which does not give out mutable
references.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Final<T>where
T: Freeze,
impl<T> RefUnwindSafe for Final<T>where
T: RefUnwindSafe,
impl<T> Send for Final<T>where
T: Send,
impl<T> Sync for Final<T>where
T: Sync,
impl<T> Unpin for Final<T>where
T: Unpin,
impl<T> UnwindSafe for Final<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