pub struct Header {Show 22 fields
pub version: u8,
pub flags: u8,
pub metadata_offset: u64,
pub metadata_len: u64,
pub dictionary_offset: u64,
pub dictionary_len: u64,
pub root_dir_offset: u64,
pub root_dir_len: u64,
pub pyramid_meta_offset: u64,
pub pyramid_meta_len: u64,
pub dict_codec: u8,
pub block_codec: u8,
pub pyramid_levels: u16,
pub quad_count: u64,
pub term_count: u64,
pub content_hash: [u8; 16],
pub named_graphs_offset: u64,
pub named_graphs_len: u64,
pub schema_meta_len: u32,
pub text_index_offset: u64,
pub text_index_len: u64,
pub extra_sections: Vec<Section>,
}Expand description
Decoded file header. All multi-byte fields are little-endian on disk. The
*_offset / *_len fields are a convenience view over the section directory
(populated from it on parse, emitted back to it on serialize).
Fields§
§version: u8Format version of the parsed file (currently
MIN_STABLE_READ_VERSION through CURRENT_FORMAT_VERSION).
flags: u8§metadata_offset: u64§metadata_len: u64§dictionary_offset: u64§dictionary_len: u64§root_dir_offset: u64§root_dir_len: u64§pyramid_meta_offset: u64§pyramid_meta_len: u64§dict_codec: u8§block_codec: u8§pyramid_levels: u16§quad_count: u64§term_count: u64§content_hash: [u8; 16]First 16 bytes of the blake3 content hash — an immutable validator.
named_graphs_offset: u64Named-graphs section (0 if the file has only the default graph).
named_graphs_len: u64§schema_meta_len: u32Byte length of the trailing schema-pyramid block within the pyramid-meta
section (0 if none). A reader fetches only that block — at
pyramid_meta_offset + pyramid_meta_len - schema_meta_len — for an
index/dictionary/summary-free Tier-0 coherence check.
text_index_offset: u64Full-text index section (0 if the file has none; built with
rete build --text-index). See SectionKind::TextIndex.
text_index_len: u64§extra_sections: Vec<Section>Directory entries whose SectionKind this build doesn’t recognize,
preserved verbatim. Empty for a file this crate wrote.
Implementations§
Source§impl Header
impl Header
Sourcepub fn from_bytes(b: &[u8]) -> Result<Self, HeaderError>
pub fn from_bytes(b: &[u8]) -> Result<Self, HeaderError>
Parse a header from the first 1024 bytes of a file.
pub fn has_quads(&self) -> bool
Sourcepub fn has_quoted_triples(&self) -> bool
pub fn has_quoted_triples(&self) -> bool
Does the file contain RDF-star quoted triples ([FLAG_HAS_QUOTED_TRIPLES])?
Sourcepub fn has_tile_synopsis(&self) -> bool
pub fn has_tile_synopsis(&self) -> bool
Do the tiled index sections carry a [FLAG_TILE_SYNOPSIS] trailer?
Sourcepub fn section(&self, kind: SectionKind) -> Option<Section>
pub fn section(&self, kind: SectionKind) -> Option<Section>
The directory entry for a section kind, or None if absent. Known kinds
read from the named convenience fields; unknown kinds from
extra_sections.
Sourcepub fn with_section(self, kind: SectionKind, offset: u64, length: u64) -> Self
pub fn with_section(self, kind: SectionKind, offset: u64, length: u64) -> Self
Attach (or overwrite) a section’s (offset, length) — the extension point
for new top-level sections. Known kinds set the named fields; an unknown
kind is appended to extra_sections.
Trait Implementations§
impl Eq for Header
impl StructuralPartialEq for Header
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnsafeUnpin for Header
impl UnwindSafe for Header
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more