Skip to main content

IdMapper

Trait IdMapper 

Source
pub trait IdMapper:
    Send
    + Sync
    + Debug {
    // Required methods
    fn address(&self, native: &str) -> Address;
    fn hash(&self, native: &str) -> B256;
    fn native_hash(&self, hash: &B256) -> Option<String>;
}
Expand description

How native ids become EVM addresses and hashes, and (where possible) back again.

Required Methods§

Source

fn address(&self, native: &str) -> Address

Source

fn hash(&self, native: &str) -> B256

Source

fn native_hash(&self, hash: &B256) -> Option<String>

Recover the native id from a hash produced by IdMapper::hash, if this mapper can.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§