pub struct Lexer<R: Read> { /* private fields */ }Expand description
PDF Lexer for tokenizing PDF content
Implementations§
Source§impl<R: Read> Lexer<R>
impl<R: Read> Lexer<R>
Sourcepub fn next_token(&mut self) -> ParseResult<Token>
pub fn next_token(&mut self) -> ParseResult<Token>
Get the next token
Sourcepub fn read_newline(&mut self) -> ParseResult<()>
pub fn read_newline(&mut self) -> ParseResult<()>
Read a newline sequence (CR, LF, or CRLF)
Sourcepub fn read_bytes(&mut self, n: usize) -> ParseResult<Vec<u8>>
pub fn read_bytes(&mut self, n: usize) -> ParseResult<Vec<u8>>
Read exactly n bytes
Sourcepub fn read_until_sequence(&mut self, sequence: &[u8]) -> ParseResult<Vec<u8>>
pub fn read_until_sequence(&mut self, sequence: &[u8]) -> ParseResult<Vec<u8>>
Read until a specific byte sequence is found
Sourcepub fn push_token(&mut self, token: Token)
pub fn push_token(&mut self, token: Token)
Push back a token to be returned by the next call to next_token
Auto Trait Implementations§
impl<R> Freeze for Lexer<R>where
R: Freeze,
impl<R> RefUnwindSafe for Lexer<R>where
R: RefUnwindSafe,
impl<R> Send for Lexer<R>where
R: Send,
impl<R> Sync for Lexer<R>where
R: Sync,
impl<R> Unpin for Lexer<R>where
R: Unpin,
impl<R> UnwindSafe for Lexer<R>where
R: UnwindSafe,
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