pub struct FileHeader {
pub magic: [u8; 4],
pub format_version: u32,
pub engine_version: EngineVersion,
pub block_size: u32,
pub compression_level: u8,
pub flags: FileFlags,
pub uncompressed_size: u64,
pub block_count: u64,
}Expand description
Fixed 64-byte header at the start of every CRSH file.
Fields§
§magic: [u8; 4]§format_version: u32§engine_version: EngineVersion§block_size: u32§compression_level: u8§flags: FileFlags§uncompressed_size: u64u64::MAX = unknown (streaming input).
block_count: u64u64::MAX = unknown (streaming input).
Implementations§
Source§impl FileHeader
impl FileHeader
pub const SIZE: usize = 64
Sourcepub fn new(
block_size: u32,
compression_level: u8,
flags: FileFlags,
uncompressed_size: u64,
block_count: u64,
) -> Self
pub fn new( block_size: u32, compression_level: u8, flags: FileFlags, uncompressed_size: u64, block_count: u64, ) -> Self
Build a header from engine configuration values.
Sourcepub fn from_bytes(b: &[u8; 64]) -> Result<Self>
pub fn from_bytes(b: &[u8; 64]) -> Result<Self>
Deserialize and validate a 64-byte slice.
§Errors
CrushError::InvalidFormatif magic bytes are wrong.CrushError::VersionMismatchifformat_versiondiffers.
Trait Implementations§
Source§impl Clone for FileHeader
impl Clone for FileHeader
Source§fn clone(&self) -> FileHeader
fn clone(&self) -> FileHeader
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 FileHeader
impl Debug for FileHeader
Source§impl PartialEq for FileHeader
impl PartialEq for FileHeader
impl Eq for FileHeader
impl StructuralPartialEq for FileHeader
Auto Trait Implementations§
impl Freeze for FileHeader
impl RefUnwindSafe for FileHeader
impl Send for FileHeader
impl Sync for FileHeader
impl Unpin for FileHeader
impl UnsafeUnpin for FileHeader
impl UnwindSafe for FileHeader
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