pub struct Bootstrap { /* private fields */ }Expand description
Manages the peer discovery and joining process.
Queries DHT for bootstrap records, extracts node IDs, and progressively joins peers until the local node is connected to the topic.
Implementations§
Source§impl Bootstrap
impl Bootstrap
Sourcepub async fn new(
record_publisher: RecordPublisher,
gossip: Gossip,
) -> Result<Self>
pub async fn new( record_publisher: RecordPublisher, gossip: Gossip, ) -> Result<Self>
Create a new bootstrap process for a topic.
Sourcepub async fn bootstrap(&self) -> Result<Receiver<()>>
pub async fn bootstrap(&self) -> Result<Receiver<()>>
Start the bootstrap process.
Returns a receiver that signals completion when the node has joined the topic (has at least one neighbor).
Sourcepub async fn gossip_sender(&self) -> Result<GossipSender>
pub async fn gossip_sender(&self) -> Result<GossipSender>
Get the gossip sender for this topic.
Sourcepub async fn gossip_receiver(&self) -> Result<GossipReceiver>
pub async fn gossip_receiver(&self) -> Result<GossipReceiver>
Get the gossip receiver for this topic.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Bootstrap
impl RefUnwindSafe for Bootstrap
impl Send for Bootstrap
impl Sync for Bootstrap
impl Unpin for Bootstrap
impl UnwindSafe for Bootstrap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more