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<T: Signing + Verification>(
        &self,
        recipient: PublicKey,
        peers: Vec<PublicKey>,
        secp_ctx: &Secp256k1<T>
    ) -> Result<Vec<BlindedPath>, ()>;
}
Expand description

A trait defining behavior for routing an OnionMessage.

Required Methods§

source

fn find_path( &self, sender: PublicKey, peers: Vec<PublicKey>, destination: Destination ) -> Result<OnionMessagePath, ()>

Returns a route for sending an OnionMessage to the given Destination.

source

fn create_blinded_paths<T: Signing + Verification>( &self, recipient: PublicKey, peers: Vec<PublicKey>, secp_ctx: &Secp256k1<T> ) -> Result<Vec<BlindedPath>, ()>

Creates BlindedPaths 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.

Implementors§

source§

impl<G: Deref<Target = NetworkGraph<L>> + Clone, L: Deref, ES: Deref, S: Deref, SP: Sized, Sc: ScoreLookUp<ScoreParams = SP>> MessageRouter for DefaultRouter<G, L, ES, S, SP, Sc>
where L::Target: Logger, S::Target: for<'a> LockableScore<'a, ScoreLookUp = Sc>, ES::Target: EntropySource,

source§

impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, ES: Deref> MessageRouter for DefaultMessageRouter<G, L, ES>