breez_sdk_liquid::lightning_125::routing::router

Enum CandidateRouteHop

pub enum CandidateRouteHop<'a> {
    FirstHop(FirstHopCandidate<'a>),
    PublicHop(PublicHopCandidate<'a>),
    PrivateHop(PrivateHopCandidate<'a>),
    Blinded(BlindedPathCandidate<'a>),
    OneHopBlinded(OneHopBlindedPathCandidate<'a>),
}
Expand description

A wrapper around the various hop representations.

Can be used to examine the properties of a hop, potentially to decide whether to include it in a route.

Variants§

§

FirstHop(FirstHopCandidate<'a>)

A hop from the payer, where the outbound liquidity is known.

§

PublicHop(PublicHopCandidate<'a>)

A hop found in the ReadOnlyNetworkGraph.

§

PrivateHop(PrivateHopCandidate<'a>)

A private hop communicated by the payee, generally via a BOLT 11 invoice.

Because BOLT 11 route hints can take multiple hops to get to the destination, this may not terminate at the payee.

§

Blinded(BlindedPathCandidate<'a>)

A blinded path which starts with an introduction point and ultimately terminates with the payee.

Because we don’t know the payee’s identity, CandidateRouteHop::target will return None in this state.

Because blinded paths are “all or nothing”, and we cannot use just one part of a blinded path, the full path is treated as a single CandidateRouteHop.

§

OneHopBlinded(OneHopBlindedPathCandidate<'a>)

Similar to Self::Blinded, but the path here only has one hop.

While we treat this similarly to CandidateRouteHop::Blinded in many respects (e.g. returning None from CandidateRouteHop::target), in this case we do actually know the payee’s identity - it’s the introduction point!

BlindedPayInfo provided for 1-hop blinded paths is ignored because it is meant to apply to the hops between the introduction node and the destination.

This primarily exists to track that we need to included a blinded path at the end of our Route, even though it doesn’t actually add an additional hop in the payment.

Implementations§

§

impl<'a> CandidateRouteHop<'a>

pub fn globally_unique_short_channel_id(&self) -> Option<u64>

Returns the globally unique short channel ID for this hop, if one is known.

This only returns Some if the channel is public (either our own, or one we’ve learned from the public network graph), and thus the short channel ID we have for this channel is globally unique and identifies this channel in a global namespace.

pub fn cltv_expiry_delta(&self) -> u32

Returns the required difference in HTLC CLTV expiry between the Self::source and the next-hop for an HTLC taking this hop.

This is the time that the node(s) in this hop have to claim the HTLC on-chain if the next-hop goes on chain with a payment preimage.

pub fn htlc_minimum_msat(&self) -> u64

Returns the minimum amount that can be sent over this hop, in millisatoshis.

pub fn fees(&self) -> RoutingFees

Returns the fees that must be paid to route an HTLC over this channel.

pub fn source(&self) -> NodeId

Returns the source node id of current hop.

Source node id refers to the node forwarding the HTLC through this hop.

For Self::FirstHop we return payer’s node id.

pub fn target(&self) -> Option<NodeId>

Returns the target node id of this hop, if known.

Target node id refers to the node receiving the HTLC after this hop.

For Self::Blinded we return None because the ultimate destination after the blinded path is unknown.

For Self::OneHopBlinded we return None because the target is the same as the source, and such a return value would be somewhat nonsensical.

Trait Implementations§

§

impl<'a> Clone for CandidateRouteHop<'a>

§

fn clone(&self) -> CandidateRouteHop<'a>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<'a> Debug for CandidateRouteHop<'a>

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for CandidateRouteHop<'a>

§

impl<'a> RefUnwindSafe for CandidateRouteHop<'a>

§

impl<'a> Send for CandidateRouteHop<'a>

§

impl<'a> Sync for CandidateRouteHop<'a>

§

impl<'a> Unpin for CandidateRouteHop<'a>

§

impl<'a> UnwindSafe for CandidateRouteHop<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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,