pub struct DiscoveryCoordinator { /* private fields */ }Expand description
Discovery coordinator that manages multiple discovery backends.
Implementations§
Source§impl DiscoveryCoordinator
impl DiscoveryCoordinator
pub fn new() -> Self
Sourcepub fn add_backend(&mut self, backend: Box<dyn DiscoveryBackend>)
pub fn add_backend(&mut self, backend: Box<dyn DiscoveryBackend>)
Add a discovery backend.
Sourcepub async fn start_all(&mut self) -> Result<(), DiscoveryError>
pub async fn start_all(&mut self) -> Result<(), DiscoveryError>
Start all discovery backends.
Sourcepub async fn poll_all(&mut self) -> Vec<DiscoveredPeer>
pub async fn poll_all(&mut self) -> Vec<DiscoveredPeer>
Poll all backends for new peers. Returns only newly discovered peers.
Sourcepub async fn stop_all(&mut self) -> Result<(), DiscoveryError>
pub async fn stop_all(&mut self) -> Result<(), DiscoveryError>
Stop all discovery backends.
Sourcepub fn known_peer_count(&self) -> usize
pub fn known_peer_count(&self) -> usize
Number of known peers.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for DiscoveryCoordinator
impl !UnwindSafe for DiscoveryCoordinator
impl Freeze for DiscoveryCoordinator
impl Send for DiscoveryCoordinator
impl Sync for DiscoveryCoordinator
impl Unpin for DiscoveryCoordinator
impl UnsafeUnpin for DiscoveryCoordinator
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more