pub struct GossipPool { /* private fields */ }Expand description
Live handle to a running gossip pool.
Implementations§
Source§impl GossipPool
impl GossipPool
Sourcepub async fn start(config: GossipConfig) -> Result<Arc<Self>, OverlayError>
pub async fn start(config: GossipConfig) -> Result<Arc<Self>, OverlayError>
Start a gossip pool. Spawns the chitchat background task + a watcher
that publishes TopologyEvents as peers join/leave/change.
§Errors
Returns OverlayError::NetworkConfig if self_info cannot be encoded
or if the chitchat server fails to bind to gossip_listen.
Sourcepub async fn peers(&self) -> Vec<PeerInfo>
pub async fn peers(&self) -> Vec<PeerInfo>
Snapshot of all currently-known peers (excluding self).
Sourcepub fn subscribe_updates(&self) -> Receiver<TopologyEvent>
pub fn subscribe_updates(&self) -> Receiver<TopologyEvent>
Subscribe to topology change events. Each subscriber gets a fresh
broadcast::Receiver — late-joiners do NOT replay history.
Sourcepub async fn announce_self(&self, info: &PeerInfo) -> Result<(), OverlayError>
pub async fn announce_self(&self, info: &PeerInfo) -> Result<(), OverlayError>
Re-publish this node’s PeerInfo (e.g. after a WireGuard key rotation).
§Errors
Returns OverlayError::NetworkConfig if info cannot be JSON-encoded.
Sourcepub fn cluster_id(&self) -> &str
pub fn cluster_id(&self) -> &str
Cluster id this pool belongs to.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for GossipPool
impl !UnwindSafe for GossipPool
impl Freeze for GossipPool
impl Send for GossipPool
impl Sync for GossipPool
impl Unpin for GossipPool
impl UnsafeUnpin for GossipPool
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