Struct ScorerAccountingForInFlightHtlcs

Source
pub struct ScorerAccountingForInFlightHtlcs<'a, S: Deref>
where S::Target: ScoreLookUp,
{ /* private fields */ }
Expand description

ScoreLookUp implementation that factors in in-flight HTLC liquidity.

Useful for custom Router implementations to wrap their ScoreLookUp on-the-fly when calling find_route.

Implementations§

Source§

impl<'a, S: Deref> ScorerAccountingForInFlightHtlcs<'a, S>
where S::Target: ScoreLookUp,

Source

pub fn new(scorer: S, inflight_htlcs: &'a InFlightHtlcs) -> Self

Initialize a new ScorerAccountingForInFlightHtlcs.

Trait Implementations§

Source§

impl<'a, S: Deref> ScoreLookUp for ScorerAccountingForInFlightHtlcs<'a, S>
where S::Target: ScoreLookUp,

Source§

type ScoreParams = <<S as Deref>::Target as ScoreLookUp>::ScoreParams

A configurable type which should contain various passed-in parameters for configuring the scorer, on a per-routefinding-call basis through to the scorer methods, which are used to determine the parameters for the suitability of channels for use.
Source§

fn channel_penalty_msat( &self, candidate: &CandidateRouteHop<'_>, usage: ChannelUsage, score_params: &Self::ScoreParams, ) -> u64

Returns the fee in msats willing to be paid to avoid routing send_amt_msat through the given channel in the direction from source to target. Read more

Auto Trait Implementations§

§

impl<'a, S> Freeze for ScorerAccountingForInFlightHtlcs<'a, S>
where S: Freeze,

§

impl<'a, S> RefUnwindSafe for ScorerAccountingForInFlightHtlcs<'a, S>
where S: RefUnwindSafe,

§

impl<'a, S> Send for ScorerAccountingForInFlightHtlcs<'a, S>
where S: Send,

§

impl<'a, S> Sync for ScorerAccountingForInFlightHtlcs<'a, S>
where S: Sync,

§

impl<'a, S> Unpin for ScorerAccountingForInFlightHtlcs<'a, S>
where S: Unpin,

§

impl<'a, S> UnwindSafe for ScorerAccountingForInFlightHtlcs<'a, S>
where S: UnwindSafe,

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

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, 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.
Source§

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

Source§

fn vzip(self) -> V