Skip to main content

Header06

Struct Header06 

Source
pub struct Header06 {
Show 22 fields pub flags: u8, pub content_hash: [u8; 16], pub file_len: u64, pub root_len: u32, pub card_region_len: u32, pub data_offset: u64, pub quad_count: u64, pub term_count: u64, pub graph_count: u64, pub perm_mask: u8, pub dict_codec: u8, pub block_codec: u8, pub internal_codec: u8, pub pyramid_levels: u16, pub id_widths: u8, pub presence: u16, pub card_off: u32, pub card_len: u32, pub card_digest: [u8; 16], pub build_off: u32, pub build_len: u32, pub root_digest: [u8; 16],
}
Expand description

The parsed 128-byte header.

Fields§

§flags: u8§content_hash: [u8; 16]§file_len: u64§root_len: u32§card_region_len: u32§data_offset: u64§quad_count: u64§term_count: u64§graph_count: u64§perm_mask: u8§dict_codec: u8§block_codec: u8§internal_codec: u8§pyramid_levels: u16§id_widths: u8

Per-position term-id widths, 2 bits each (subjects, objects, predicates, graphs from the low bits): 0 = u32, 1 = u64 (refused by this reader).

§presence: u16§card_off: u32§card_len: u32§card_digest: [u8; 16]§build_off: u32§build_len: u32§root_digest: [u8; 16]

Implementations§

Source§

impl Header06

Source

pub fn to_bytes(&self) -> [u8; 128]

Serialize the fixed 128 bytes.

Source

pub fn from_bytes(b: &[u8]) -> Result<Header06, FileError>

Parse and bounds-check the fixed 128 bytes. Every field is untrusted.

Source

pub fn root_offset(&self) -> u64

Absolute offset of the root block.

Source

pub fn card_region_offset(&self) -> u64

Absolute offset of the card region.

Source

pub fn front_base(&self) -> u64

Absolute offset where the front sections start (after the card region).

Source

pub fn card_range(&self) -> ByteRange

The stored card’s absolute range (len == 0: no card).

Source

pub fn build_range(&self) -> ByteRange

The build record’s absolute range (len == 0: none).

Source

pub fn perms(&self) -> PermSet

The permutations the file carries.

Source

pub fn has(&self, bit: u16) -> bool

Does the file carry this presence bit?

Trait Implementations§

Source§

impl Clone for Header06

Source§

fn clone(&self) -> Header06

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Header06

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for Header06

Source§

fn default() -> Header06

Returns the “default value” for a type. Read more
Source§

impl Eq for Header06

Source§

impl PartialEq for Header06

Source§

fn eq(&self, other: &Header06) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Header06

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V