pub trait MessageRouter {
// Required methods
fn find_path(
&self,
sender: PublicKey,
peers: Vec<PublicKey>,
destination: Destination,
) -> Result<OnionMessagePath, ()>;
fn create_blinded_paths<T: Signing + Verification>(
&self,
recipient: PublicKey,
local_node_receive_key: ReceiveAuthKey,
context: MessageContext,
peers: Vec<MessageForwardNode>,
secp_ctx: &Secp256k1<T>,
) -> Result<Vec<BlindedMessagePath>, ()>;
}Expand description
A trait defining behavior for routing an OnionMessage.
Required Methods§
Sourcefn find_path(
&self,
sender: PublicKey,
peers: Vec<PublicKey>,
destination: Destination,
) -> Result<OnionMessagePath, ()>
fn find_path( &self, sender: PublicKey, peers: Vec<PublicKey>, destination: Destination, ) -> Result<OnionMessagePath, ()>
Returns a route for sending an OnionMessage to the given Destination.
Sourcefn create_blinded_paths<T: Signing + Verification>(
&self,
recipient: PublicKey,
local_node_receive_key: ReceiveAuthKey,
context: MessageContext,
peers: Vec<MessageForwardNode>,
secp_ctx: &Secp256k1<T>,
) -> Result<Vec<BlindedMessagePath>, ()>
fn create_blinded_paths<T: Signing + Verification>( &self, recipient: PublicKey, local_node_receive_key: ReceiveAuthKey, context: MessageContext, peers: Vec<MessageForwardNode>, secp_ctx: &Secp256k1<T>, ) -> Result<Vec<BlindedMessagePath>, ()>
Creates BlindedMessagePaths to the recipient node. The nodes in peers are assumed to
be direct peers with the recipient.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.