Trait MessageRouter
pub trait MessageRouter {
// Required methods
fn find_path(
&self,
sender: PublicKey,
peers: Vec<PublicKey>,
destination: Destination,
) -> Result<OnionMessagePath, ()>;
fn create_blinded_paths<T>(
&self,
recipient: PublicKey,
peers: Vec<PublicKey>,
secp_ctx: &Secp256k1<T>,
) -> Result<Vec<BlindedPath>, ()>
where T: Signing + Verification;
}
Expand description
A trait defining behavior for routing an OnionMessage
.
Required Methods§
fn 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
.
fn create_blinded_paths<T>(
&self,
recipient: PublicKey,
peers: Vec<PublicKey>,
secp_ctx: &Secp256k1<T>,
) -> Result<Vec<BlindedPath>, ()>where
T: Signing + Verification,
fn create_blinded_paths<T>(
&self,
recipient: PublicKey,
peers: Vec<PublicKey>,
secp_ctx: &Secp256k1<T>,
) -> Result<Vec<BlindedPath>, ()>where
T: Signing + Verification,
Creates BlindedPath
s 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.