Skip to main content

XrefEntry

Enum XrefEntry 

Source
#[non_exhaustive]
pub enum XrefEntry { InUse { offset: u64, generation: u16, }, Free { next_free: u32, generation: u16, }, InStream { stream_num: u32, index: u32, }, }
Expand description

One cross-reference entry: §7.5.4’s classic n/f types plus §7.5.8.3 Table 18’s type-2 compressed-object entry.

#[non_exhaustive]: §7.5.8.3 explicitly reserves further entry types (“any other value shall be interpreted as a reference to the null object, thus permitting new entry types to be defined in the future”), so downstream matches must stay open.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

InUse

Classic type n / stream type 1: the object lives at offset (from the beginning of the file) with generation generation.

Fields

§offset: u64

Byte offset of the object’s N G obj header.

§generation: u16

Generation that a reference must match to resolve.

§

Free

Classic type f / stream type 0: the object number is free. Kept (not dropped!) — free-with-generation-65535 entries are how hybrid files hide objects, and a free entry shadows an older in-use entry during the first-wins merge (deletion via incremental update).

Fields

§next_free: u32

Object number of the next free object (the linked list).

§generation: u16

Generation to assign when this number is next reused.

§

InStream

Stream type 2 (§7.5.8.3 Table 18): the object is compressed inside an object stream (§7.5.7).

Note what this variant deliberately does not carry: a generation. A type-2 entry has no generation field at all — its field 3 is the index within the container — because §7.3.10/ §7.5.7 fix the generation of every compressed object, and of the container itself, at 0. Storing a generation here would invent information the file does not contain.

Fields

§stream_num: u32

Object number of the object stream holding this object. Its generation is implicitly 0.

§index: u32

0-based index of this object within that object stream’s pair table.

Trait Implementations§

Source§

impl Clone for XrefEntry

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for XrefEntry

Source§

impl Debug for XrefEntry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for XrefEntry

Source§

impl PartialEq for XrefEntry

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for XrefEntry

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.