@@ -1039,6 +1039,7 @@ pub struct BackgroundProcessorConfigAsync<
10391039 sleeper : Sleeper ,
10401040 mobile_interruptable_platform : bool ,
10411041 fetch_time : FetchTime ,
1042+ /// Phantom data to ensure proper lifetime and type parameter constraints.
10421043 _phantom : PhantomData < & ' a ( ) > ,
10431044}
10441045
@@ -1110,6 +1111,7 @@ pub struct BackgroundProcessorConfigAsyncBuilder<
11101111 sleeper : Sleeper ,
11111112 mobile_interruptable_platform : bool ,
11121113 fetch_time : FetchTime ,
1114+ /// Phantom data to ensure proper lifetime and type parameter constraints.
11131115 _phantom : PhantomData < & ' a ( ) > ,
11141116}
11151117
@@ -1309,43 +1311,6 @@ impl BackgroundProcessor {
13091311 /// background processing. To build this configuration, you can use the [`BackgroundProcessorConfigBuilder`]
13101312 /// which provides a convenient builder pattern for setting up both required and optional components.
13111313 ///
1312- /// # Data Persistence
1313- ///
1314- /// [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
1315- /// uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
1316- /// [`ChannelManager`]. See the `lightning-persister` crate for LDK's
1317- /// provided implementation.
1318- ///
1319- /// [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
1320- /// [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
1321- /// See the `lightning-persister` crate for LDK's provided implementation.
1322- ///
1323- /// Typically, users should either implement [`Persister::persist_manager`] to never return an
1324- /// error or call [`join`] and handle any error that may arise. For the latter case,
1325- /// `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
1326- ///
1327- /// # Event Handling
1328- ///
1329- /// The `event_handler` in the configuration is responsible for handling events that users should be notified of (e.g.,
1330- /// payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
1331- /// functionality implemented by other handlers.
1332- /// * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
1333- ///
1334- /// # Rapid Gossip Sync
1335- ///
1336- /// If rapid gossip sync is meant to run at startup, pass [`RapidGossipSync`] via `gossip_sync`
1337- /// to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
1338- /// until the [`RapidGossipSync`] instance completes its first sync.
1339- ///
1340- /// [top-level documentation]: BackgroundProcessor
1341- /// [`join`]: Self::join
1342- /// [`stop`]: Self::stop
1343- /// [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
1344- /// [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
1345- /// [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
1346- /// [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
1347- /// [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
1348- /// [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
13491314 pub fn start <
13501315 ' a ,
13511316 UL : ' static + Deref ,
@@ -1566,6 +1531,44 @@ impl BackgroundProcessor {
15661531///
15671532/// The configuration can be constructed using [`BackgroundProcessorConfigBuilder`], which provides
15681533/// a convenient builder pattern for setting up both required and optional components.
1534+ ///
1535+ /// # Data Persistence
1536+ ///
1537+ /// [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
1538+ /// uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
1539+ /// [`ChannelManager`]. See the `lightning-persister` crate for LDK's
1540+ /// provided implementation.
1541+ ///
1542+ /// [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
1543+ /// [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
1544+ /// See the `lightning-persister` crate for LDK's provided implementation.
1545+ ///
1546+ /// Typically, users should either implement [`Persister::persist_manager`] to never return an
1547+ /// error or call [`BackgroundProcessor::join`] and handle any error that may arise. For the latter case,
1548+ /// `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
1549+ ///
1550+ /// # Event Handling
1551+ ///
1552+ /// The `event_handler` in the configuration is responsible for handling events that users should be notified of (e.g.,
1553+ /// payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
1554+ /// functionality implemented by other handlers.
1555+ /// * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
1556+ ///
1557+ /// # Rapid Gossip Sync
1558+ ///
1559+ /// If rapid gossip sync is meant to run at startup, pass [`RapidGossipSync`] via `gossip_sync`
1560+ /// to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
1561+ /// until the [`RapidGossipSync`] instance completes its first sync.
1562+ ///
1563+ /// [top-level documentation]: BackgroundProcessor
1564+ /// [`BackgroundProcessor::join`]: BackgroundProcessor::join
1565+ /// [`BackgroundProcessor::stop`]: BackgroundProcessor::stop
1566+ /// [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
1567+ /// [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
1568+ /// [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
1569+ /// [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
1570+ /// [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
1571+ /// [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
15691572#[ cfg( feature = "std" ) ]
15701573pub struct BackgroundProcessorConfig <
15711574 ' a ,
@@ -1623,6 +1626,7 @@ pub struct BackgroundProcessorConfig<
16231626 sweeper : Option < OS > ,
16241627 logger : L ,
16251628 scorer : Option < S > ,
1629+ /// Phantom data to ensure proper lifetime and type parameter constraints.
16261630 _phantom : PhantomData < ( & ' a ( ) , CF , T , F , P ) > ,
16271631}
16281632
@@ -1688,6 +1692,7 @@ pub struct BackgroundProcessorConfigBuilder<
16881692 sweeper : Option < OS > ,
16891693 logger : L ,
16901694 scorer : Option < S > ,
1695+ /// Phantom data to ensure proper lifetime and type parameter constraints.
16911696 _phantom : PhantomData < ( & ' a ( ) , CF , T , F , P ) > ,
16921697}
16931698
0 commit comments