pub(crate) enum HeaderOffset {
Original(Offset32),
Extended(Offset32),
}Expand description
The offset a header field resolves through, for headers that carry both an original 16-bit offset and an extended 32-bit one.
The extended offset applies when the header version has it and it is nonzero; otherwise the original one does.
Variants§
Implementations§
Source§impl HeaderOffset
impl HeaderOffset
Sourcepub(crate) fn select(
original: Nullable<Offset16>,
extended: Option<Nullable<Offset32>>,
has_extended: bool,
) -> Result<Self, ReadError>
pub(crate) fn select( original: Nullable<Offset16>, extended: Option<Nullable<Offset32>>, has_extended: bool, ) -> Result<Self, ReadError>
Chooses between the two offsets of a header field. An extended header too short to hold its extended offset is an error.
pub(crate) fn offset(self) -> Offset32
pub(crate) fn is_null(self) -> bool
Trait Implementations§
Source§impl Clone for HeaderOffset
impl Clone for HeaderOffset
Source§fn clone(&self) -> HeaderOffset
fn clone(&self) -> HeaderOffset
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for HeaderOffset
Source§impl Debug for HeaderOffset
impl Debug for HeaderOffset
impl Eq for HeaderOffset
Source§impl PartialEq for HeaderOffset
impl PartialEq for HeaderOffset
impl StructuralPartialEq for HeaderOffset
Auto Trait Implementations§
impl Freeze for HeaderOffset
impl RefUnwindSafe for HeaderOffset
impl Send for HeaderOffset
impl Sync for HeaderOffset
impl Unpin for HeaderOffset
impl UnsafeUnpin for HeaderOffset
impl UnwindSafe for HeaderOffset
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