#[non_exhaustive]pub struct Write<T: ?Sized> { /* private fields */ }Expand description
Implementations§
Source§impl<T: ?Sized> Write<T>
impl<T: ?Sized> Write<T>
Sourcepub unsafe fn assume(v: &T) -> &Self
pub unsafe fn assume(v: &T) -> &Self
Asserts that the given reference can be safely written to.
§Safety
In order to maintain the invariants of the garbage collector, no new Gc pointers
may be adopted by the referenced value as a result of the interior mutability enabled
by this wrapper, unless Gc::write is invoked manually on the parent Gc
pointer during the current arena callback.
Sourcepub fn from_static(v: &T) -> &Selfwhere
T: 'static,
pub fn from_static(v: &T) -> &Selfwhere
T: 'static,
Gets a writable reference to non-GC’d data.
This is safe, as 'static types can never hold Gc pointers.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Write<T>
impl<T> RefUnwindSafe for Write<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Send for Write<T>
impl<T> Sync for Write<T>
impl<T> Unpin for Write<T>
impl<T> UnwindSafe for Write<T>where
T: UnwindSafe + ?Sized,
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