pub struct FileFooter {
pub index_offset: u64,
pub index_size: u32,
pub footer_checksum: u32,
pub format_version: u32,
pub magic: [u8; 4],
}Expand description
Fixed 24-byte record at the very end of every CRSH file.
Reading algorithm:
- Seek to
file_size - 24. - Read and deserialize this struct.
- Validate magic,
format_version, andfooter_checksum. - Seek to
index_offsetto read the index region.
Fields§
§index_offset: u64Absolute byte offset of the IndexHeader from start of file.
index_size: u32Byte length of the index region: 8 + 20 * block_count.
CRC32 of bytes [0..12] of this footer (protects index_offset + index_size).
format_version: u32Redundant copy of FileHeader::format_version.
magic: [u8; 4]Implementations§
pub const SIZE: usize = 24
pub fn to_bytes(self) -> [u8; 24]
Sourcepub fn from_bytes(b: &[u8; 24]) -> Result<Self>
pub fn from_bytes(b: &[u8; 24]) -> Result<Self>
Deserialize and validate a 24-byte footer.
§Errors
CrushError::InvalidFormatif magic is wrong or checksum fails.CrushError::VersionMismatchifformat_versiondiffers.
Trait Implementations§
Source§fn clone(&self) -> FileFooter
fn clone(&self) -> FileFooter
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 moreAuto Trait Implementations§
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> 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