pub struct Variant<'a> { /* private fields */ }Expand description
A decoded variant that holds the type and the value of its child.
A variant carries a dynamic child type, so decode
parses the child into a Value once and keeps it. Variant::value
borrows that value. It walks no bytes again and clones nothing.
Variant is the one building block that allocates on decode. Variants
occur only inside a{sv} metadata, so a dirtree walk or an xattr scan does
not decode one.
A Variant also keeps the borrowed child bytes and signature.
encode writes them again, so the output equals the
input byte for byte. The encode builds no signature string.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> Forget for Variant<'a>
impl<'a> Freeze for Variant<'a>
impl<'a> Move for Variant<'a>
impl<'a> RefUnwindSafe for Variant<'a>
impl<'a> Send for Variant<'a>
impl<'a> Sync for Variant<'a>
impl<'a> Unpin for Variant<'a>
impl<'a> UnsafeUnpin for Variant<'a>where
*const Type is !null: UnsafeUnpin,
PhantomData<Type>: UnsafeUnpin,
NonZeroU64Inner: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
&'a [u8]: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const Value is !null: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const (Type, Value) is !null: UnsafeUnpin,
PhantomData<(Type, Value)>: UnsafeUnpin,
impl<'a> UnwindSafe for Variant<'a>where
BoxRaw<Type>: UnwindSafe,
NonZero<u64>: UnwindSafe,
RawVecInner: UnwindSafe,
&'a [u8]: UnwindSafe,
BoxRaw<Value>: UnwindSafe,
BoxRaw<(Type, Value)>: 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