Skip to main content

ErrorSignatureRegistry

Trait ErrorSignatureRegistry 

Source
pub trait ErrorSignatureRegistry: Send + Sync {
    // Required methods
    fn get_by_selector(&self, selector: [u8; 4]) -> Vec<ErrorSignature>;
    fn get_by_name(&self, name: &str) -> Option<ErrorSignature>;
    fn len(&self) -> usize;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

Trait for looking up error signatures by 4-byte selector.

Required Methods§

Source

fn get_by_selector(&self, selector: [u8; 4]) -> Vec<ErrorSignature>

Look up all known signatures matching a 4-byte selector. Returns multiple signatures when there are collisions.

Source

fn get_by_name(&self, name: &str) -> Option<ErrorSignature>

Look up a signature by full name (e.g. "InsufficientBalance").

Source

fn len(&self) -> usize

Total number of registered signatures.

Provided Methods§

Source

fn is_empty(&self) -> bool

Returns true if the registry is empty.

Implementors§