Trait ParseOp

Source
pub trait ParseOp {
    type Op;
    type Error: Debug + Display;

    // Required method
    fn parse_op(
        &self,
        bytes: &mut impl Iterator<Item = u8>,
    ) -> Result<Self::Op, Self::Error>;
}
Expand description

Parse the operation associated with the opcode.

Required Associated Types§

Source

type Op

The operation associated with the opcode.

Source

type Error: Debug + Display

Any error that might occur while parsing.

Required Methods§

Source

fn parse_op( &self, bytes: &mut impl Iterator<Item = u8>, ) -> Result<Self::Op, Self::Error>

Attempt to parse the operation associated with the opcode from the given bytes.

Only consumes the bytes necessary to construct any associated data.

Returns an error in the case that the given bytes iterator contains insufficient bytes to parse the op.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§