pub trait NodeAddressResolver:
Send
+ Sync
+ Debug {
// Required methods
fn address_of(&self, node_id: &NodeId) -> Option<Address>;
fn node_id_for(&self, address: &Address) -> Option<NodeId>;
}Expand description
Read-only resolver from a provider’s iroh NodeId to its bonded operator
Ethereum Address. Implementations MUST be cheap to clone (typically
Arc<inner>); the pull orchestrator holds a long-lived
Arc<dyn NodeAddressResolver> and calls Self::address_of once per
candidate it intends to pay.
Required Methods§
Sourcefn address_of(&self, node_id: &NodeId) -> Option<Address>
fn address_of(&self, node_id: &NodeId) -> Option<Address>
The bonded operator address for node_id, or None if the node is not
currently registered. None means the caller MUST NOT attempt a paid
pull from it — there is no address to open a channel to or to verify the
slash_sig against.
Sourcefn node_id_for(&self, address: &Address) -> Option<NodeId>
fn node_id_for(&self, address: &Address) -> Option<NodeId>
Reverse lookup: a registered NodeId currently bound to address, or
None if no registered node binds it (deregistered / never seen).
The buyer-channel reconcile (#972) keys channels by the provider’s
operator address but must dial the provider by NodeId to request a
cooperative-close waiver. An operator may run several nodes under one
address; any is dialable for this purpose — they share the operator key
that signs the waiver — so the first match is returned. None is the
“unreachable / gone” signal: the caller leaves the channel for the
expiry-reclaim sweep rather than dialing.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".