struct RawVarZeroCow {
buf: NonNull<[u8]>,
owned: bool,
}Expand description
VarZeroCow without the V to simulate a dropck eyepatch
(i.e., prove to rustc that the dtor is not able to observe V or ’a)
This is effectively Cow<'a, [u8]>, with the lifetime managed externally
Fields§
§buf: NonNull<[u8]>Pointer to data
§Safety Invariants
- This slice must always be valid as a byte slice
- If
ownedis true, this slice can be freed. VarZeroCow, the only user of this type, will impose an additional invariant that the buffer is a valid V
owned: boolThe buffer is Box<[u8]> if true
Implementations§
Trait Implementations§
Source§impl Clone for RawVarZeroCow
impl Clone for RawVarZeroCow
Source§impl Drop for RawVarZeroCow
Available on crate feature alloc only.
impl Drop for RawVarZeroCow
Available on crate feature
alloc only.impl Send for RawVarZeroCow
impl Sync for RawVarZeroCow
Auto Trait Implementations§
impl Freeze for RawVarZeroCow
impl RefUnwindSafe for RawVarZeroCow
impl Unpin for RawVarZeroCow
impl UnsafeUnpin for RawVarZeroCow
impl UnwindSafe for RawVarZeroCow
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