pub struct LabelIndex { /* private fields */ }Expand description
A parsed LABEL_INDEX: the root resident, inner nodes and blocks on demand.
Implementations§
Source§impl LabelIndex
impl LabelIndex
Sourcepub fn from_section(section: &[u8], codec: u8) -> Result<LabelIndex, FileError>
pub fn from_section(section: &[u8], codec: u8) -> Result<LabelIndex, FileError>
Parse a whole section held in memory, checking its digest.
Sourcepub fn from_head(
head: &[u8],
section_len: u64,
codec: u8,
loader: Box<dyn Fn(u64, u64) -> Option<Vec<u8>> + Sync + Send>,
) -> Result<LabelIndex, FileError>
pub fn from_head( head: &[u8], section_len: u64, codec: u8, loader: Box<dyn Fn(u64, u64) -> Option<Vec<u8>> + Sync + Send>, ) -> Result<LabelIndex, FileError>
Open from the section’s leading bytes (head, at least the preamble;
normally HEAD_READ bytes) and a loader for any range of the section.
The root is read from head when it fits, else fetched.
Sourcepub fn entry_count(&self) -> u64
pub fn entry_count(&self) -> u64
Number of entries in the index.
Sourcepub fn section_len(&self) -> u64
pub fn section_len(&self) -> u64
Byte length of the whole section.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for LabelIndex
impl !RefUnwindSafe for LabelIndex
impl !UnwindSafe for LabelIndex
impl Send for LabelIndex
impl Sync for LabelIndex
impl Unpin for LabelIndex
impl UnsafeUnpin for LabelIndex
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