pub trait EngineAccess {
// Required methods
fn has_path(&self, dest: &[u8; 16]) -> bool;
fn hops_to(&self, dest: &[u8; 16]) -> Option<u8>;
fn next_hop(&self, dest: &[u8; 16]) -> Option<[u8; 16]>;
fn is_blackholed(&self, identity: &[u8; 16]) -> bool;
fn interface_name(&self, id: u64) -> Option<String>;
fn interface_mode(&self, id: u64) -> Option<u8>;
fn identity_hash(&self) -> Option<[u8; 16]>;
fn announce_rate(&self, id: u64) -> Option<i32>;
fn link_state(&self, link_hash: &[u8; 16]) -> Option<u8>;
}Expand description
Trait for querying engine state from within WASM host functions.
rns-hooks cannot depend on rns-core, so this trait defines the
interface in neutral terms. rns-net provides the concrete implementation
via a thin wrapper around TransportEngine.
Required Methods§
fn has_path(&self, dest: &[u8; 16]) -> bool
fn hops_to(&self, dest: &[u8; 16]) -> Option<u8>
fn next_hop(&self, dest: &[u8; 16]) -> Option<[u8; 16]>
fn is_blackholed(&self, identity: &[u8; 16]) -> bool
fn interface_name(&self, id: u64) -> Option<String>
fn interface_mode(&self, id: u64) -> Option<u8>
fn identity_hash(&self) -> Option<[u8; 16]>
Sourcefn announce_rate(&self, id: u64) -> Option<i32>
fn announce_rate(&self, id: u64) -> Option<i32>
Outgoing announce rate for an interface, in millihertz (Hz * 1000). Returns None if the interface is not found.