pub struct PsTokenizer { /* private fields */ }Expand description
The tokenizer (PSTokenizer): reads PostScript tokens from a buffer, which
can switch to the decrypted eexec part and back.
Implementations§
Source§impl PsTokenizer
impl PsTokenizer
Sourcepub fn new(buf: &[u8], encoding: &str) -> Self
pub fn new(buf: &[u8], encoding: &str) -> Self
A tokenizer over buf, whose tokens are decoded with encoding
(PSTokenizer(buf, encoding)).
Sourcepub fn read(&mut self, n: Option<usize>) -> Result<Vec<u8>, PsError>
pub fn read(&mut self, n: Option<usize>) -> Result<Vec<u8>, PsError>
Reads at most n bytes, or all the rest when n is None (read).
Sourcepub fn get_next_token(
&mut self,
) -> Result<Option<(&'static str, String)>, PsError>
pub fn get_next_token( &mut self, ) -> Result<Option<(&'static str, String)>, PsError>
The next token and its type (getnexttoken): "do_special",
"do_comment", "do_string", "do_hexstring", "do_literal", or ""
for names and numbers; None at the end.
Sourcepub fn starteexec(&mut self) -> Result<(), PsError>
pub fn starteexec(&mut self) -> Result<(), PsError>
Switches to the decrypted eexec part, after the byte that follows
eexec (starteexec).
Trait Implementations§
Source§impl Clone for PsTokenizer
impl Clone for PsTokenizer
Auto Trait Implementations§
impl Forget for PsTokenizer
impl Freeze for PsTokenizer
impl Move for PsTokenizer
impl RefUnwindSafe for PsTokenizer
impl Send for PsTokenizerwhere
RawVecInner: Send,
impl Sync for PsTokenizerwhere
RawVecInner: Sync,
impl Unpin for PsTokenizer
impl UnsafeUnpin for PsTokenizer
impl UnwindSafe for PsTokenizerwhere
RawVecInner: 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