Struct spacetimedb_table::layout::ProductTypeLayout
source · pub struct ProductTypeLayout {
pub layout: Layout,
pub elements: Box<[ProductTypeElementLayout]>,
}Expand description
A mirror of ProductType annotated with a Layout.
Fields§
§layout: LayoutThe memoized layout of the product type.
elements: Box<[ProductTypeElementLayout]>The fields of the product type with their own layout annotations.
Implementations§
source§impl ProductTypeLayout
impl ProductTypeLayout
sourcepub fn algebraic_type(&self) -> AlgebraicType
pub fn algebraic_type(&self) -> AlgebraicType
Convert a ProductTypeLayout back into an AlgebraicType::Product,
removing layout information.
This operation is O(n) in the number of nodes in the argument, and will heap-allocate. It is intended for use in error paths, where performance is a secondary concern.
source§impl ProductTypeLayout
impl ProductTypeLayout
sourcepub fn offset_of_element(&self, field_idx: usize) -> usize
pub fn offset_of_element(&self, field_idx: usize) -> usize
Returns the offset of the element at field_idx.
Trait Implementations§
source§impl Debug for ProductTypeLayout
impl Debug for ProductTypeLayout
source§impl From<ProductType> for ProductTypeLayout
impl From<ProductType> for ProductTypeLayout
source§fn from(ty: ProductType) -> Self
fn from(ty: ProductType) -> Self
Converts to this type from the input type.
source§impl From<ProductTypeLayout> for RowTypeLayout
impl From<ProductTypeLayout> for RowTypeLayout
source§fn from(cols: ProductTypeLayout) -> Self
fn from(cols: ProductTypeLayout) -> Self
Converts to this type from the input type.
source§impl HasLayout for ProductTypeLayout
impl HasLayout for ProductTypeLayout
source§impl PartialEq for ProductTypeLayout
impl PartialEq for ProductTypeLayout
source§fn eq(&self, other: &ProductTypeLayout) -> bool
fn eq(&self, other: &ProductTypeLayout) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for ProductTypeLayout
impl StructuralPartialEq for ProductTypeLayout
Auto Trait Implementations§
impl RefUnwindSafe for ProductTypeLayout
impl Send for ProductTypeLayout
impl Sync for ProductTypeLayout
impl Unpin for ProductTypeLayout
impl UnwindSafe for ProductTypeLayout
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