pub trait Opcode: Debug + Display {
// Required methods
fn request_opcode(&self) -> u8;
fn response_opcode(&self) -> Option<u8>;
fn serialise(&self, buf: &mut [u8]) -> Result<usize>;
fn disasm(bin: &[u8], pc: &mut usize) -> Result<Self>
where Self: Sized;
// Provided methods
fn branch_target(&self) -> Option<u8> { ... }
fn is_unconditional_branch(&self) -> bool { ... }
}Required Methods§
fn request_opcode(&self) -> u8
fn response_opcode(&self) -> Option<u8>
fn serialise(&self, buf: &mut [u8]) -> Result<usize>
fn disasm(bin: &[u8], pc: &mut usize) -> Result<Self>where
Self: Sized,
Provided Methods§
fn branch_target(&self) -> Option<u8>
fn is_unconditional_branch(&self) -> bool
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".