pub struct Boxed<T: ?Sized> { /* private fields */ }Expand description
An owned value of a serialization, like a Box.
The value is either in the arena of the state (which is how
Emit::seq, Emit::map,
Emit::structure and
SerializeHandle::arena allocate
it) or on the heap (Box::new(value).into()). The arena belongs to the
state, the emitters of the open containers are on top of each other in
it, allocating one bumps a pointer and the space is reused once it’s
dropped. A value in the arena can be kept after the serialization, the
chunk of the arena it’s in is then freed when it’s dropped (the rest of
the arena right away). A value that is meant to be kept should rather
be on the heap.
Trait Implementations§
impl<T: ?Sized + Send> Send for Boxed<T>
impl<T: ?Sized + Sync> Sync for Boxed<T>
Auto Trait Implementations§
impl<T> Freeze for Boxed<T>
impl<T> RefUnwindSafe for Boxed<T>
impl<T> Unpin for Boxed<T>
impl<T> UnsafeUnpin for Boxed<T>
impl<T> UnwindSafe for Boxed<T>
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