pub struct SlabTableEntry {
pub slab_type: SlabType,
pub start_offset: u64,
pub byte_length: u64,
}Expand description
One slab-table entry, decoded but not yet bound to file/buffer data.
Fields§
§slab_type: SlabTypeThe on-disk type tag of the slab.
start_offset: u64Byte offset from the start of the file to the slab’s first byte.
byte_length: u64Slab length in bytes. Guaranteed to be a multiple of
slab_type.element_size() when produced by SlabTableEntry::parse.
Implementations§
Source§impl SlabTableEntry
impl SlabTableEntry
Sourcepub fn parse(bytes: &[u8], index: usize) -> Result<Self, ParseError>
pub fn parse(bytes: &[u8], index: usize) -> Result<Self, ParseError>
Parse one 12-byte slab-table entry. Validates the type byte and
that byte_length is a multiple of the element size. Does not
validate that the slab fits in any particular buffer — the caller
supplies that bound.
bytes must be at least SLAB_TABLE_ENTRY_SIZE long; only the
first 12 bytes are read.
Trait Implementations§
Source§impl Clone for SlabTableEntry
impl Clone for SlabTableEntry
impl Copy for SlabTableEntry
Auto Trait Implementations§
impl Freeze for SlabTableEntry
impl RefUnwindSafe for SlabTableEntry
impl Send for SlabTableEntry
impl Sync for SlabTableEntry
impl Unpin for SlabTableEntry
impl UnsafeUnpin for SlabTableEntry
impl UnwindSafe for SlabTableEntry
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