#[repr(C)]pub struct FileDataSequenceHeader {
pub file_hash: MerkleHash,
pub file_flags: u32,
pub num_entries: u32,
pub _unused: u64,
}Expand description
Each file consists of a FileDataSequenceHeader following a sequence of FileDataSequenceEntry, maybe a sequence of FileVerificationEntry, and maybe a FileMetadataExt determined by file flags.
Fields§
§file_hash: MerkleHash§file_flags: u32§num_entries: u32§_unused: u64Implementations§
Source§impl FileDataSequenceHeader
impl FileDataSequenceHeader
pub fn new<I: TryInto<u32>>( file_hash: MerkleHash, num_entries: I, contains_verification: bool, contains_metadata_ext: bool, ) -> Self
pub fn bookend() -> Self
pub fn is_bookend(&self) -> bool
pub fn serialize<W: Write>(&self, writer: &mut W) -> Result<usize, Error>
pub fn deserialize<R: Read>(reader: &mut R) -> Result<Self, Error>
pub fn contains_metadata_ext(&self) -> bool
pub fn contains_verification(&self) -> bool
Sourcepub fn num_info_entry_following(&self) -> u32
pub fn num_info_entry_following(&self) -> u32
Get the number of info entries following the header in this shard, this includes “FileDataSequenceEntry“s, “FileVerificationEntry“s, and “FileMetadataExt”.
Sourcepub fn verify_same_file(header1: &Self, header2: &Self)
pub fn verify_same_file(header1: &Self, header2: &Self)
Verifies that the two headers correspond to the same file. Checks that the file hashes are the same and that the number of entries are the same.
Sourcepub fn compare_flag_superset(header_a: &Self, header_b: &Self) -> SupersetResult
pub fn compare_flag_superset(header_a: &Self, header_b: &Self) -> SupersetResult
Compares the flags of headers A and B to determine if either bitmap is a superset of the other. Can return 4 possible responses:
- SuperA if A is a superset of B (e.g. A has validation and B has nothing)
- SuperB if B is a superset of A (e.g. B has metadata_ext and A has nothing)
- Neither if neither A nor B are supersets of each other (e.g. A has only validation, and B has only metadata_ext)
- Equal if both A and B have the same flags set.
Trait Implementations§
Source§impl Clone for FileDataSequenceHeader
impl Clone for FileDataSequenceHeader
Source§fn clone(&self) -> FileDataSequenceHeader
fn clone(&self) -> FileDataSequenceHeader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileDataSequenceHeader
impl Debug for FileDataSequenceHeader
Source§impl Default for FileDataSequenceHeader
impl Default for FileDataSequenceHeader
Source§fn default() -> FileDataSequenceHeader
fn default() -> FileDataSequenceHeader
Returns the “default value” for a type. Read more
Source§impl PartialEq for FileDataSequenceHeader
impl PartialEq for FileDataSequenceHeader
Source§impl Serialize for FileDataSequenceHeader
impl Serialize for FileDataSequenceHeader
impl StructuralPartialEq for FileDataSequenceHeader
Auto Trait Implementations§
impl Freeze for FileDataSequenceHeader
impl RefUnwindSafe for FileDataSequenceHeader
impl Send for FileDataSequenceHeader
impl Sync for FileDataSequenceHeader
impl Unpin for FileDataSequenceHeader
impl UnsafeUnpin for FileDataSequenceHeader
impl UnwindSafe for FileDataSequenceHeader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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