Trait lightning::onion_message::messenger::MessageRouter
source · pub trait MessageRouter {
// Required methods
fn find_path(
&self,
sender: PublicKey,
peers: Vec<PublicKey>,
destination: Destination
) -> Result<OnionMessagePath, ()>;
fn create_blinded_paths<ES: EntropySource + ?Sized, T: Signing + Verification>(
&self,
recipient: PublicKey,
peers: Vec<PublicKey>,
entropy_source: &ES,
secp_ctx: &Secp256k1<T>
) -> Result<Vec<BlindedPath>, ()>;
}
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<ES: EntropySource + ?Sized, T: Signing + Verification>(
&self,
recipient: PublicKey,
peers: Vec<PublicKey>,
entropy_source: &ES,
secp_ctx: &Secp256k1<T>
) -> Result<Vec<BlindedPath>, ()>
fn create_blinded_paths<ES: EntropySource + ?Sized, T: Signing + Verification>( &self, recipient: PublicKey, peers: Vec<PublicKey>, entropy_source: &ES, secp_ctx: &Secp256k1<T> ) -> Result<Vec<BlindedPath>, ()>
Creates BlindedPath
s to the recipient
node. The nodes in peers
are assumed to be
direct peers with the recipient
.
Object Safety§
This trait is not object safe.