Struct Partial

Source
pub struct Partial<'s> { /* private fields */ }
Expand description

A partially-initialized shape, useful when deserializing for example.

Implementations§

Source§

impl Partial<'_>

Source

pub fn alloc(shape_desc: ShapeDesc) -> Self

Allocates a partial on the heap for the given shape descriptor.

Source

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().

Source

pub fn scalar_slot(&mut self) -> Option<Slot<'_>>

Returns a slot for assigning this whole shape as a scalar

Source

pub fn slot<'s>(&'s mut self, field: Field<'_>) -> Option<Slot<'s>>

Returns a slot for initializing a field in the shape.

Source

pub fn build_in_place(self)

Source

pub fn build<T: Shapely>(self) -> T

Source

pub fn build_boxed<T: Shapely>(self) -> Box<T>

Source

pub fn shape_desc(&self) -> ShapeDesc

Source

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.

Source

pub unsafe fn move_into(self, target: *mut u8)

§Safety

The target pointer must be valid and properly aligned, and must be large enough to hold the value.

Trait Implementations§

Source§

impl Drop for Partial<'_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.