pub struct ObjectParser<'a> { /* private fields */ }Implementations§
Source§impl<'a> ObjectParser<'a>
impl<'a> ObjectParser<'a>
pub fn new(data: &'a [u8], limits: &'a ParseLimits) -> Self
Sourcepub fn parse_indirect_at(&self, offset: usize) -> Result<PdfObject>
pub fn parse_indirect_at(&self, offset: usize) -> Result<PdfObject>
Parse an indirect object at the given byte offset.
Expected format: <num> <gen> obj <value> endobj
Sourcepub fn parse_indirect_with_id(
&self,
offset: usize,
) -> Result<(ObjectId, PdfObject)>
pub fn parse_indirect_with_id( &self, offset: usize, ) -> Result<(ObjectId, PdfObject)>
Like parse_indirect_at, but also returns
the (num, gen) actually present in the object header. Callers that
arrived here via an xref entry can compare it against the id they asked
for and trigger repair on a mismatch (stale/corrupt offsets are common
in damaged files).
Auto Trait Implementations§
impl<'a> Freeze for ObjectParser<'a>
impl<'a> RefUnwindSafe for ObjectParser<'a>
impl<'a> Send for ObjectParser<'a>
impl<'a> Sync for ObjectParser<'a>
impl<'a> Unpin for ObjectParser<'a>
impl<'a> UnsafeUnpin for ObjectParser<'a>
impl<'a> UnwindSafe for ObjectParser<'a>
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