Skip to main content

OpcodeTable

Trait OpcodeTable 

Source
pub trait OpcodeTable:
    Sized
    + Copy
    + 'static {
    type Group: OpcodeGroup;

    // Required methods
    fn to_str(&self) -> &'static str;
    fn to_operator(&self) -> Option<&'static str>;
    fn to_size(&self) -> Option<&'static str>;
    fn from_size(size: &str, group: Self::Group) -> Option<Self>;
    fn is_32bit(&self) -> bool;
    fn group(self) -> Self::Group;
    fn by_group(group: Self::Group) -> &'static [Self];
    fn try_from_sbpf_v3(opcode: u8) -> Result<Self, OpcodeError>;
    fn all() -> &'static [Self];
}
Expand description

Trait for OpcodeTable metadata, group membership, and byte conversions.

Required Associated Types§

Required Methods§

Source

fn to_str(&self) -> &'static str

Source

fn to_operator(&self) -> Option<&'static str>

Source

fn to_size(&self) -> Option<&'static str>

Source

fn from_size(size: &str, group: Self::Group) -> Option<Self>

Source

fn is_32bit(&self) -> bool

Source

fn group(self) -> Self::Group

Source

fn by_group(group: Self::Group) -> &'static [Self]

Source

fn try_from_sbpf_v3(opcode: u8) -> Result<Self, OpcodeError>

Source

fn all() -> &'static [Self]

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§