breez_sdk_liquid::lightning_125::routing::router

Struct DefaultRouter

pub struct DefaultRouter<G, L, ES, S, SP, Sc>
where G: Deref<Target = NetworkGraph<L>>, L: Deref, ES: Deref, S: Deref, Sc: ScoreLookUp<ScoreParams = SP>, <L as Deref>::Target: Logger, <S as Deref>::Target: for<'a> LockableScore<'a, ScoreLookUp = Sc>, <ES as Deref>::Target: EntropySource,
{ /* private fields */ }
Expand description

A Router implemented using find_route.

§Privacy

Implements MessageRouter by delegating to DefaultMessageRouter. See those docs for privacy implications.

Implementations§

§

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

pub fn new( network_graph: G, logger: L, entropy_source: ES, scorer: S, score_params: SP, ) -> DefaultRouter<G, L, ES, S, SP, Sc>

Creates a new router.

Trait Implementations§

§

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

§

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, context: MessageContext, peers: Vec<PublicKey>, secp_ctx: &Secp256k1<T>, ) -> Result<Vec<BlindedMessagePath>, ()>
where T: Signing + Verification,

Creates BlindedMessagePaths to the recipient node. The nodes in peers are assumed to be direct peers with the recipient.
§

fn create_compact_blinded_paths<T>( &self, recipient: PublicKey, context: MessageContext, peers: Vec<MessageForwardNode>, secp_ctx: &Secp256k1<T>, ) -> Result<Vec<BlindedMessagePath>, ()>
where T: Signing + Verification,

Creates compact BlindedMessagePaths to the recipient node. The nodes in peers are assumed to be direct peers with the recipient. Read more
§

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

§

fn find_route( &self, payer: &PublicKey, params: &RouteParameters, first_hops: Option<&[&ChannelDetails]>, inflight_htlcs: InFlightHtlcs, ) -> Result<Route, LightningError>

Finds a Route for a payment between the given payer and a payee. Read more
§

fn create_blinded_payment_paths<T>( &self, recipient: PublicKey, first_hops: Vec<ChannelDetails>, tlvs: ReceiveTlvs, amount_msats: u64, secp_ctx: &Secp256k1<T>, ) -> Result<Vec<BlindedPaymentPath>, ()>
where T: Signing + Verification,

Creates BlindedPaymentPaths for payment to the recipient node. The channels in first_hops are assumed to be with the recipient’s peers. The payment secret and any constraints are given in tlvs.
§

fn find_route_with_id( &self, payer: &PublicKey, route_params: &RouteParameters, first_hops: Option<&[&ChannelDetails]>, inflight_htlcs: InFlightHtlcs, _payment_hash: PaymentHash, _payment_id: PaymentId, ) -> Result<Route, LightningError>

Finds a Route for a payment between the given payer and a payee. Read more

Auto Trait Implementations§

§

impl<G, L, ES, S, SP, Sc> Freeze for DefaultRouter<G, L, ES, S, SP, Sc>
where G: Freeze, L: Freeze, ES: Freeze, S: Freeze, SP: Freeze,

§

impl<G, L, ES, S, SP, Sc> RefUnwindSafe for DefaultRouter<G, L, ES, S, SP, Sc>

§

impl<G, L, ES, S, SP, Sc> Send for DefaultRouter<G, L, ES, S, SP, Sc>
where G: Send, L: Send, ES: Send, S: Send, SP: Send,

§

impl<G, L, ES, S, SP, Sc> Sync for DefaultRouter<G, L, ES, S, SP, Sc>
where G: Sync, L: Sync, ES: Sync, S: Sync, SP: Sync,

§

impl<G, L, ES, S, SP, Sc> Unpin for DefaultRouter<G, L, ES, S, SP, Sc>
where G: Unpin, L: Unpin, ES: Unpin, S: Unpin, SP: Unpin,

§

impl<G, L, ES, S, SP, Sc> UnwindSafe for DefaultRouter<G, L, ES, S, SP, Sc>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> DartSafe for T

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T

§

impl<T> TaskRetFutTrait for T
where T: Send,