Trait spacetimedb_table::layout::HasLayout
source · pub trait HasLayout {
// Required method
fn layout(&self) -> &Layout;
// Provided methods
fn size(&self) -> usize { ... }
fn align(&self) -> usize { ... }
}Expand description
A type which knows what its layout is.
This does not refer to layout in Rust.
Required Methods§
Provided Methods§
sourcefn size(&self) -> usize
fn size(&self) -> usize
Returns the size, in bytes, for objects of this type.
Intentionally returns usize rather than Size,
so callers will have to explicitly convert
with row_size_for_bytes.
sourcefn align(&self) -> usize
fn align(&self) -> usize
Returns the alignment, in bytes, for objects of this type.
Intentionally returns usize rather than Size,
so callers will have to explicitly convert
with row_size_for_bytes.