pub struct FileHeader {
pub block_size: u32,
pub blocks: u32,
pub chunks: u32,
pub checksum: u32,
}
Expand description
Global file header
Fields§
§block_size: u32
Block size in bytes (should be multiple of 4)
blocks: u32
Number of blocks in the expanded image
chunks: u32
Number of chunks in the sparse image
checksum: u32
Optional CRC32 Checksum
Implementations§
Source§impl FileHeader
impl FileHeader
Sourcepub fn from_bytes(bytes: &FileHeaderBytes) -> Result<FileHeader, ParseError>
pub fn from_bytes(bytes: &FileHeaderBytes) -> Result<FileHeader, ParseError>
Create new FileHeader from a raw header
Sourcepub fn to_bytes(&self) -> FileHeaderBytes
pub fn to_bytes(&self) -> FileHeaderBytes
Convert into a raw header
pub fn total_size(&self) -> usize
Trait Implementations§
Source§impl Clone for FileHeader
impl Clone for FileHeader
Source§fn clone(&self) -> FileHeader
fn clone(&self) -> FileHeader
Returns a copy 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 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