pub struct Decoder<'a> {
pub bytecode: &'a [u8],
pub pc: usize,
}
Expand description
Decodes instructions from TrueType bytecode.
Fields§
§bytecode: &'a [u8]
The bytecode for the program.
pc: usize
The “program counter” or current offset into the bytecode.
Implementations§
source§impl<'a> Decoder<'a>
impl<'a> Decoder<'a>
sourcepub fn new(bytecode: &'a [u8], pc: usize) -> Self
pub fn new(bytecode: &'a [u8], pc: usize) -> Self
Creates a new decoder for the given bytecode and program counter.
sourcepub fn decode(&mut self) -> Option<Result<Instruction<'a>, DecodeError>>
pub fn decode(&mut self) -> Option<Result<Instruction<'a>, DecodeError>>
Decodes the next instruction.
Returns None
at the end of the bytecode stream.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Decoder<'a>
impl<'a> RefUnwindSafe for Decoder<'a>
impl<'a> Send for Decoder<'a>
impl<'a> Sync for Decoder<'a>
impl<'a> Unpin for Decoder<'a>
impl<'a> UnwindSafe for Decoder<'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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)