pub struct Section {
pub id: u32,
pub kind: SectionKind,
pub offset: u64,
pub len: u64,
pub digest: Digest,
}Expand description
One run of bytes in the payload area.
Fields§
§id: u32What the rest of the container refers to this section by.
kind: SectionKindWhat it holds.
offset: u64Where it starts, counted from the start of the file.
len: u64How many bytes long it is.
digest: DigestThe digest of those bytes.
Implementations§
Source§impl Section
impl Section
Sourcepub const fn end(&self) -> Option<u64>
pub const fn end(&self) -> Option<u64>
Where the section ends, or None if the arithmetic overflows.
The Option is the point. These two numbers came out of a file somebody else wrote, and the
first thing a hostile one does is pick an offset and a length that add up to something
small.
Trait Implementations§
impl Copy for Section
Source§impl<'de> Deserialize<'de> for Section
impl<'de> Deserialize<'de> for Section
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Section
impl StructuralPartialEq for Section
Auto Trait Implementations§
impl Freeze for Section
impl RefUnwindSafe for Section
impl Send for Section
impl Sync for Section
impl Unpin for Section
impl UnsafeUnpin for Section
impl UnwindSafe for Section
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