#[repr(C)]pub struct SectionEntry {
pub section_id: u32,
pub encoding: u32,
pub offset: u64,
pub size: u64,
pub checksum: [u8; 8],
}Fields§
§section_id: u32§encoding: u32§offset: u64§size: u64§checksum: [u8; 8]Implementations§
Source§impl SectionEntry
impl SectionEntry
pub fn new(section_id: u32, offset: u64, size: u64) -> Self
Sourcepub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_bytes(&self) -> &[u8] ⓘ
The exact on-disk bytes of this record (little-endian host only,
which is every supported target; see layout::tests).
Sourcepub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
pub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
Mutable view over the on-disk bytes; from_bytes-style readers copy
a slice in here. Sound for any content because every field accepts
every bit pattern (Pod).
pub fn compute_checksum(&mut self, data: &[u8])
pub fn validate_checksum(&self, data: &[u8]) -> Result<()>
Trait Implementations§
Source§impl Clone for SectionEntry
impl Clone for SectionEntry
impl Copy for SectionEntry
Source§impl Debug for SectionEntry
impl Debug for SectionEntry
Source§impl PartialEq for SectionEntry
impl PartialEq for SectionEntry
impl Pod for SectionEntry
impl StructuralPartialEq for SectionEntry
Auto Trait Implementations§
impl Freeze for SectionEntry
impl RefUnwindSafe for SectionEntry
impl Send for SectionEntry
impl Sync for SectionEntry
impl Unpin for SectionEntry
impl UnsafeUnpin for SectionEntry
impl UnwindSafe for SectionEntry
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: Pod,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.