pub struct Parser<'a, 'd> { /* private fields */ }Expand description
Parses objects from a buffer.
Implementations§
Source§impl<'a, 'd> Parser<'a, 'd>
impl<'a, 'd> Parser<'a, 'd>
Sourcepub fn new(
buf: &'a [u8],
base: u64,
limits: &'d Limits,
strictness: Strictness,
) -> Self
pub fn new( buf: &'a [u8], base: u64, limits: &'d Limits, strictness: Strictness, ) -> Self
A parser over buf, whose first byte is at file offset base.
Sourcepub fn with_diagnostics(self, diagnostics: &'d Diagnostics) -> Self
pub fn with_diagnostics(self, diagnostics: &'d Diagnostics) -> Self
Records repairs into diagnostics.
Sourcepub fn parse_object(&mut self) -> Result<Object>
pub fn parse_object(&mut self) -> Result<Object>
Parses one direct object.
Sourcepub fn parse_indirect(
&mut self,
expected: Option<ObjId>,
) -> Result<(ObjId, Object, ObjectEnd)>
pub fn parse_indirect( &mut self, expected: Option<ObjId>, ) -> Result<(ObjId, Object, ObjectEnd)>
Parses num gen obj <object> and what ends it. When expected is
given, a different id is an error.
Sourcepub fn parse_dict(&mut self) -> Result<Dict>
pub fn parse_dict(&mut self) -> Result<Dict>
Parses a trailer dictionary, after the trailer keyword.
Auto Trait Implementations§
impl<'a, 'd> !RefUnwindSafe for Parser<'a, 'd>
impl<'a, 'd> !UnwindSafe for Parser<'a, 'd>
impl<'a, 'd> Freeze for Parser<'a, 'd>
impl<'a, 'd> Send for Parser<'a, 'd>
impl<'a, 'd> Sync for Parser<'a, 'd>
impl<'a, 'd> Unpin for Parser<'a, 'd>
impl<'a, 'd> UnsafeUnpin for Parser<'a, 'd>
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