Module spacetimedb_table::layout
source · Expand description
Defines Layout
, which encompasses the fixed size and alignment of an object,
e.g., a row, or a column, or some other sub-division of a row.
Layout
annotated versions of SATS types are also provided,
such as ProductTypeLayout
and AlgebraicTypeLayout
.
These, and others, determine what the layout of objects typed at those types are.
They also implement HasLayout
which generalizes over layout annotated types.
Structs§
- The layout of a fixed object or the layout that fixed objects of a type will have.
- A mirrior of
ProductTypeElement
annotated with aLayout
. - A mirror of
ProductType
annotated with aLayout
. - The type of a row, annotated with a
Layout
. - A mirrior of
SumTypeVariant
annotated with aLayout
.
Enums§
- Mostly a mirror of
AlgebraicType
annotated with aLayout
. - Variants of
BuiltinType
which do not require aVarLenRef
indirection, i.e. bools, integers and floats. BuiltinType
variants which require aVarLenRef
indirection, i.e. strings, arrays and maps.
Constants§
- Fixed-length row portions must also be sufficiently aligned to store a
FreeCellRef
. - Fixed-length row portions must be at least large enough to store a
FreeCellRef
.
Traits§
- A type which knows what its layout is.
Functions§
- Aligns a
base
offset to therequired_alignment
and returns it. - Computes the size of
val
when BSATN encoding without actually encoding. - Counts the number of
VarLenGranule
allocations required to storeval
in a page. - Returns the minimum row size needed to store
required_bytes
accounting for the minimum row size and alignment. - Returns the minimum row size needed to store a
T
, accounting for the minimum row size and alignment.