pub struct PostingHeader {
pub count: u32,
pub code_bytes: u32,
pub stuck: u32,
}Expand description
The fixed part at the front of one partition’s image.
Fields§
§count: u32How many members the partition holds.
code_bytes: u32How many bytes one code takes.
Derivable from the root’s dim and bits, and stored anyway for the
same reason dim is stored in a vector record: a partition can then be
cut into its four arrays without the root, which is what a reader
checking a file rather than opening one has.
stuck: u32The size at which a split was tried and found there was no cut.
Part of the image because it is not derivable: it is the memory of a split that failed, and an image that dropped it would have every partition of identical vectors try to split again on the first write after an open.
Implementations§
Source§impl PostingHeader
impl PostingHeader
Sourcepub fn encode(&self, into: &mut [u8]) -> Result<usize>
pub fn encode(&self, into: &mut [u8]) -> Result<usize>
Writes the header into the front of into.
§Errors
Code::Invalid if into is not long enough for the whole partition.
Sourcepub fn decode(bytes: &[u8]) -> Result<PostingHeader>
pub fn decode(bytes: &[u8]) -> Result<PostingHeader>
Reads a partition’s header back and checks the bytes behind it.
§Errors
Code::Corrupt if a reserved field is set or if the buffer is not
exactly the length the header describes.
Where the tags start.
Trait Implementations§
Source§impl Clone for PostingHeader
impl Clone for PostingHeader
Source§fn clone(&self) -> PostingHeader
fn clone(&self) -> PostingHeader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more