pub struct RapidGossipSync<NG: Deref<Target = NetworkGraph<L>>, L: Deref>where
L::Target: Logger,{ /* private fields */ }
Expand description
Rapid Gossip Sync struct See crate-level documentation for usage.
Implementations
sourceimpl<NG: Deref<Target = NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L>where
L::Target: Logger,
impl<NG: Deref<Target = NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L>where
L::Target: Logger,
sourcepub fn update_network_graph(
&self,
update_data: &[u8]
) -> Result<u32, GraphSyncError>
pub fn update_network_graph(
&self,
update_data: &[u8]
) -> Result<u32, GraphSyncError>
Update network graph from binary data. Returns the last sync timestamp to be used the next time rapid sync data is queried.
network_graph
: network graph to be updated
update_data
: &[u8]
binary stream that comprises the update data
sourceimpl<NG: Deref<Target = NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L>where
L::Target: Logger,
impl<NG: Deref<Target = NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L>where
L::Target: Logger,
sourcepub fn new(network_graph: NG) -> Self
pub fn new(network_graph: NG) -> Self
Instantiate a new RapidGossipSync
instance
sourcepub fn sync_network_graph_with_file_path(
&self,
sync_path: &str
) -> Result<u32, GraphSyncError>
pub fn sync_network_graph_with_file_path(
&self,
sync_path: &str
) -> Result<u32, GraphSyncError>
Sync gossip data from a file Returns the last sync timestamp to be used the next time rapid sync data is queried.
network_graph
: The network graph to apply the updates to
sync_path
: Path to the file where the gossip update data is located
sourcepub fn network_graph(&self) -> &NG
pub fn network_graph(&self) -> &NG
Gets a reference to the underlying NetworkGraph
which was provided in
RapidGossipSync::new
.
(C-not exported) as bindings don’t support a reference-to-a-reference yet
sourcepub fn is_initial_sync_complete(&self) -> bool
pub fn is_initial_sync_complete(&self) -> bool
Returns whether a rapid gossip sync has completed at least once
Auto Trait Implementations
impl<NG, L> RefUnwindSafe for RapidGossipSync<NG, L>where
NG: RefUnwindSafe,
impl<NG, L> Send for RapidGossipSync<NG, L>where
NG: Send,
impl<NG, L> Sync for RapidGossipSync<NG, L>where
NG: Sync,
impl<NG, L> Unpin for RapidGossipSync<NG, L>where
NG: Unpin,
impl<NG, L> UnwindSafe for RapidGossipSync<NG, L>where
NG: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more