pub struct Partial<'s> { /* private fields */ }
Expand description
A partially-initialized shape, useful when deserializing for example.
Implementations§
Source§impl Partial<'_>
impl Partial<'_>
Sourcepub fn alloc(shape_desc: ShapeDesc) -> Self
pub fn alloc(shape_desc: ShapeDesc) -> Self
Allocates a partial on the heap for the given shape descriptor.
Sourcepub fn borrow<T: Shapely>(uninit: &mut MaybeUninit<T>) -> Self
pub fn borrow<T: Shapely>(uninit: &mut MaybeUninit<T>) -> Self
Borrows a MaybeUninit<Self>
and returns a Partial
.
Before calling assume_init, make sure to call Partial.build_in_place().
Sourcepub fn scalar_slot(&mut self) -> Option<Slot<'_>>
pub fn scalar_slot(&mut self) -> Option<Slot<'_>>
Returns a slot for assigning this whole shape as a scalar
Sourcepub fn slot<'s>(&'s mut self, field: Field<'_>) -> Option<Slot<'s>>
pub fn slot<'s>(&'s mut self, field: Field<'_>) -> Option<Slot<'s>>
Returns a slot for initializing a field in the shape.
pub fn build_in_place(self)
pub fn build<T: Shapely>(self) -> T
pub fn build_boxed<T: Shapely>(self) -> Box<T>
pub fn shape_desc(&self) -> ShapeDesc
Sourcepub fn addr_for_display(&self) -> *const u8
pub fn addr_for_display(&self) -> *const u8
Returns the address of the underlying data — for debugging purposes only. Returns null if the data is zero-sized.
Trait Implementations§
Auto Trait Implementations§
impl<'s> Freeze for Partial<'s>
impl<'s> RefUnwindSafe for Partial<'s>
impl<'s> !Send for Partial<'s>
impl<'s> !Sync for Partial<'s>
impl<'s> Unpin for Partial<'s>
impl<'s> !UnwindSafe for Partial<'s>
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