pub struct Xref { /* private fields */ }Expand description
Where every object in a document lives.
Ordered by object number, because reading it that way is what both the
page walk and the writer want, and because the largest object number is a
value the reader consults constantly. That order is an array index rather
than a tree; the private EntryTable this wraps carries the why.
Implementations§
Source§impl Xref
impl Xref
Sourcepub fn sections(&self) -> &[Section]
pub fn sections(&self) -> &[Section]
The sections the load followed, oldest first — one per revision of an incrementally updated file. Empty when the table was rebuilt by scanning, since no chain was followed then.
Sourcepub fn entry(&self, num: u32) -> Option<Entry>
pub fn entry(&self, num: u32) -> Option<Entry>
Where object num lives, if the table says anything about it.
Sourcepub fn generation(&self, num: u32) -> u16
pub fn generation(&self, num: u32) -> u16
The generation the table records for num.
Sourcepub fn is_object_stream(&self, num: u32) -> bool
pub fn is_object_stream(&self, num: u32) -> bool
Whether some entry named num as the object stream it lives in.
Sourcepub fn object_numbers(&self) -> impl Iterator<Item = u32> + '_
pub fn object_numbers(&self) -> impl Iterator<Item = u32> + '_
Every object number the table describes, in ascending order.
Sourcepub fn last_object_number(&self) -> u32
pub fn last_object_number(&self) -> u32
The largest object number the table describes.
Sourcepub fn is_valid_object_number(&self, num: u32) -> bool
pub fn is_valid_object_number(&self, num: u32) -> bool
Whether num is a number this table could possibly describe.
Object numbers past the table’s largest are unfetchable even when the bytes for them sit in the file — the table is the only index the reader has, and PDFium refuses to look past its end.