+} LDKCResult_ScoringParametersDecodeErrorZ;
+
+
+
+/**
+ * [`Score`] implementation that provides reasonable default behavior.
+ *
+ * Used to apply a fixed penalty to each channel, thus avoiding long paths when shorter paths with
+ * slightly higher fees are available. Will further penalize channels that fail to relay payments.
+ *
+ * See [module-level documentation] for usage and [`ScoringParameters`] for customization.
+ *
+ * # Note
+ *
+ * Mixing the `no-std` feature between serialization and deserialization results in undefined
+ * behavior.
+ *
+ * [module-level documentation]: crate::routing::scoring
+ */
+typedef struct MUST_USE_STRUCT LDKScorer {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeScorer *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKScorer;
+
+/**
+ * The contents of CResult_ScorerDecodeErrorZ
+ */
+typedef union LDKCResult_ScorerDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKScorer *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_ScorerDecodeErrorZPtr;
+
+/**
+ * A CResult_ScorerDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::routing::scoring::Scorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ScorerDecodeErrorZ {
+ /**
+ * The contents of this CResult_ScorerDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ScorerDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_ScorerDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ScorerDecodeErrorZ;
+
+
+
+/**
+ * Parameters for configuring [`ProbabilisticScorer`].
+ */
+typedef struct MUST_USE_STRUCT LDKProbabilisticScoringParameters {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeProbabilisticScoringParameters *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKProbabilisticScoringParameters;
+
+/**
+ * The contents of CResult_ProbabilisticScoringParametersDecodeErrorZ
+ */
+typedef union LDKCResult_ProbabilisticScoringParametersDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKProbabilisticScoringParameters *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_ProbabilisticScoringParametersDecodeErrorZPtr;
+
+/**
+ * A CResult_ProbabilisticScoringParametersDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::routing::scoring::ProbabilisticScoringParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ProbabilisticScoringParametersDecodeErrorZ {
+ /**
+ * The contents of this CResult_ProbabilisticScoringParametersDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ProbabilisticScoringParametersDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_ProbabilisticScoringParametersDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ProbabilisticScoringParametersDecodeErrorZ;
+
+
+
+/**
+ * Represents the network as nodes and channels between them
+ */
+typedef struct MUST_USE_STRUCT LDKNetworkGraph {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeNetworkGraph *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKNetworkGraph;
+
+/**
+ * A tuple of 2 elements. See the individual fields for the types contained.
+ */
+typedef struct LDKC2Tuple_ProbabilisticScoringParametersNetworkGraphZ {
+ /**
+ * The element at position 0
+ */
+ struct LDKProbabilisticScoringParameters a;
+ /**
+ * The element at position 1
+ */
+ struct LDKNetworkGraph b;
+} LDKC2Tuple_ProbabilisticScoringParametersNetworkGraphZ;
+
+
+
+/**
+ * [`Score`] implementation using channel success probability distributions.
+ *
+ * Based on *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
+ * and Stefan Richter [[1]]. Given the uncertainty of channel liquidity balances, probability
+ * distributions are defined based on knowledge learned from successful and unsuccessful attempts.
+ * Then the negative `log10` of the success probability is used to determine the cost of routing a
+ * specific HTLC amount through a channel.
+ *
+ * Knowledge about channel liquidity balances takes the form of upper and lower bounds on the
+ * possible liquidity. Certainty of the bounds is decreased over time using a decay function. See
+ * [`ProbabilisticScoringParameters`] for details.
+ *
+ * Since the scorer aims to learn the current channel liquidity balances, it works best for nodes
+ * with high payment volume or that actively probe the [`NetworkGraph`]. Nodes with low payment
+ * volume are more likely to experience failed payment paths, which would need to be retried.
+ *
+ * # Note
+ *
+ * Mixing the `no-std` feature between serialization and deserialization results in undefined
+ * behavior.
+ *
+ * [1]: https://arxiv.org/abs/2107.05322
+ */
+typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeProbabilisticScorer *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKProbabilisticScorer;
+
+/**
+ * The contents of CResult_ProbabilisticScorerDecodeErrorZ
+ */
+typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKProbabilisticScorer *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
+
+/**
+ * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
+ /**
+ * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_ProbabilisticScorerDecodeErrorZ;
+
+
+
+/**
+ * Features used within an `init` message.
+ */
+typedef struct MUST_USE_STRUCT LDKInitFeatures {
+ /**
+ * A pointer to the opaque Rust object.
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeInitFeatures *inner;
+ /**
+ * Indicates that this is the only struct which contains the same pointer.
+ * Rust functions which take ownership of an object provided via an argument require
+ * this to be true and invalidate the object pointed to by inner.
+ */
+ bool is_owned;
+} LDKInitFeatures;
+
+/**
+ * The contents of CResult_InitFeaturesDecodeErrorZ
+ */
+typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
+ /**
+ * A pointer to the contents in the success state.
+ * Reading from this pointer when `result_ok` is not set is undefined.
+ */
+ struct LDKInitFeatures *result;
+ /**
+ * A pointer to the contents in the error state.
+ * Reading from this pointer when `result_ok` is set is undefined.
+ */
+ struct LDKDecodeError *err;
+} LDKCResult_InitFeaturesDecodeErrorZPtr;
+
+/**
+ * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
+ * `result_ok` indicates the overall state, and the contents are provided via `contents`.
+ */
+typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
+ /**
+ * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
+ * `err` or `result` depending on the state of `result_ok`.
+ */
+ union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
+ /**
+ * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
+ */
+ bool result_ok;
+} LDKCResult_InitFeaturesDecodeErrorZ;