Skip to content

Commit 3571c5e

Browse files
committed
Fix uniffi and docs
1 parent 963aa9d commit 3571c5e

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/builder.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ impl std::fmt::Debug for LogWriterConfig {
155155
}
156156
}
157157

158+
#[cfg_attr(feature = "uniffi", allow(dead_code))]
158159
enum ProbingStrategyKind {
159160
HighDegree { top_n: usize },
160161
Random { max_hops: usize },
@@ -659,13 +660,15 @@ impl NodeBuilder {
659660
/// Configures background probing toward the highest-degree nodes in the network graph.
660661
///
661662
/// `top_n` controls how many of the most-connected nodes are cycled through.
663+
#[cfg_attr(feature = "uniffi", allow(dead_code))]
662664
pub fn set_high_degree_probing_strategy(&mut self, top_n: usize) -> &mut Self {
663665
let kind = ProbingStrategyKind::HighDegree { top_n };
664666
self.probing_strategy = Some(self.make_probing_config(kind));
665667
self
666668
}
667669

668670
/// Configures background probing via random graph walks of up to `max_hops` hops.
671+
#[cfg_attr(feature = "uniffi", allow(dead_code))]
669672
pub fn set_random_probing_strategy(&mut self, max_hops: usize) -> &mut Self {
670673
let kind = ProbingStrategyKind::Random { max_hops };
671674
self.probing_strategy = Some(self.make_probing_config(kind));
@@ -674,8 +677,9 @@ impl NodeBuilder {
674677

675678
/// Configures a custom probing strategy for background channel probing.
676679
///
677-
/// When set, the node will periodically call [`ProbingStrategy::next_probe`] and dispatch the
680+
/// When set, the node will periodically call [`probing::ProbingStrategy::next_probe`] and dispatch the
678681
/// returned probe via the channel manager.
682+
#[cfg_attr(feature = "uniffi", allow(dead_code))]
679683
pub fn set_custom_probing_strategy(
680684
&mut self, strategy: Arc<dyn probing::ProbingStrategy>,
681685
) -> &mut Self {
@@ -685,6 +689,7 @@ impl NodeBuilder {
685689
}
686690

687691
/// Overrides the interval between probe attempts. Only has effect if a probing strategy is set.
692+
#[cfg_attr(feature = "uniffi", allow(dead_code))]
688693
pub fn set_probing_interval(&mut self, interval: Duration) -> &mut Self {
689694
if let Some(cfg) = &mut self.probing_strategy {
690695
cfg.interval = interval;
@@ -694,6 +699,7 @@ impl NodeBuilder {
694699

695700
/// Overrides the maximum millisatoshis that may be locked in in-flight probes at any time.
696701
/// Only has effect if a probing strategy is set.
702+
#[cfg_attr(feature = "uniffi", allow(dead_code))]
697703
pub fn set_max_probe_locked_msat(&mut self, max_msat: u64) -> &mut Self {
698704
if let Some(cfg) = &mut self.probing_strategy {
699705
cfg.max_locked_msat = max_msat;
@@ -708,15 +714,17 @@ impl NodeBuilder {
708714
/// quadratically over 24 hours.
709715
///
710716
/// This is only useful for probing strategies that route through the scorer
711-
/// (e.g., [`HighDegreeStrategy`]). Strategies that build paths manually
712-
/// (e.g., [`RandomStrategy`]) bypass the scorer entirely.
717+
/// (e.g., [`probing::HighDegreeStrategy`]). Strategies that build paths manually
718+
/// (e.g., [`probing::RandomStrategy`]) bypass the scorer entirely.
713719
///
714720
/// If unset, LDK's default of `0` (no penalty) is used.
721+
#[cfg_attr(feature = "uniffi", allow(dead_code))]
715722
pub fn set_probing_diversity_penalty_msat(&mut self, penalty_msat: u64) -> &mut Self {
716723
self.probing_diversity_penalty_msat = Some(penalty_msat);
717724
self
718725
}
719726

727+
#[cfg_attr(feature = "uniffi", allow(dead_code))]
720728
fn make_probing_config(&self, kind: ProbingStrategyKind) -> ProbingStrategyConfig {
721729
let existing = self.probing_strategy.as_ref();
722730
ProbingStrategyConfig {

0 commit comments

Comments
 (0)