[−][src]Struct dez80::decoder::InstructionDecoder
Represents an instruction decoder that maintains a state.
Its main use case is to decode instructions progressively
byte by byte, when a data source cannot implement Read
.
Implementations
impl InstructionDecoder
[src]
pub fn new() -> Self
[src]
pub fn try_decode(&mut self) -> Result<Instruction, DecodingState>
[src]
Attempts to decode one instruction from the decoder's source.
If there is not enough data to complete the decoding process,
an Err<DecodingState>
is returned, which describes the state
of the decoder prior to running out of data.
If an instruction is successfully decoded, an Ok<Instruction>
is returned, and its bytes are drained from the source.
pub fn push_byte(&mut self, byte: u8)
[src]
Pushes an opcode byte to the decoder source.
pub fn push_slice(&mut self, slice: &[u8])
[src]
Pushes a slice of opcode bytes to the decoder source.
pub fn reset(&mut self)
[src]
Resets the decoder state, allowing decoding to start from scratch.
Trait Implementations
impl Default for InstructionDecoder
[src]
fn default() -> InstructionDecoder
[src]
Auto Trait Implementations
impl RefUnwindSafe for InstructionDecoder
impl Send for InstructionDecoder
impl Sync for InstructionDecoder
impl Unpin for InstructionDecoder
impl UnwindSafe for InstructionDecoder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,