Appearance
cellpack::format::OwnedMeta
Module contract · All interfaces
At a glance
pub struct OwnedMeta { /* private fields */ }Immutable metadata bytes and a validated descriptor. Views borrow only this owner; section offsets avoid self-referential pointers and lifetime extension.
Member index
4 of 4 members
newCopies the metadata out of input (the metadata alone or a whole chunk), keeping only the meta_len bytes the header declares.from_vecValidates bytes and takes ownership of the metadata prefix, dropping anything past meta_len .bytesThe metadata bytes, exactly meta_len long.viewA descriptor borrowing self ; the section ranges stored at construction become slices of the same bytes, so repeated calls are free and never re-parse.
Methods and associated constants
new
Copies the metadata out of input (the metadata alone or a whole chunk), keeping only the meta_len bytes the header declares.
from_vec
Validates bytes and takes ownership of the metadata prefix, dropping anything past meta_len.
The section ranges recorded here are byte offsets into those same bytes, computed while the slices returned by parse_meta are still borrowed; truncation cannot invalidate them because every section lies below meta_len.
bytes
The metadata bytes, exactly meta_len long.
view
A descriptor borrowing self; the section ranges stored at construction become slices of the same bytes, so repeated calls are free and never re-parse.
The returned view lives as long as the borrow of self, not as long as the owning OwnedMeta.
Implemented traits
Contract reference
See the module reference for semantic input/output rules, units, allocation, mutation, failure behavior, and lifetime requirements. Declarations and documented members are synchronized from the crate source.