[][src]Struct dez80::decoder::InstructionDecoder

pub struct InstructionDecoder { /* fields omitted */ }

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]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.