pub struct PublicOverlay { /* private fields */ }Implementations§
Source§impl PublicOverlay
impl PublicOverlay
pub fn builder(overlay_id: OverlayId) -> PublicOverlayBuilder
pub fn overlay_id(&self) -> &OverlayId
pub fn entry_ttl_sec(&self) -> u32
pub fn peer_resolver(&self) -> &Option<PeerResolver>
pub fn unknown_peers_queue(&self) -> &UnknownPeersQueue
pub async fn query( &self, network: &Network, peer_id: &PeerId, request: Request, ) -> Result<Response>
pub async fn send( &self, network: &Network, peer_id: &PeerId, request: Request, ) -> Result<()>
Sourcepub fn ban_peer(&self, peer_id: PeerId) -> bool
pub fn ban_peer(&self, peer_id: PeerId) -> bool
Bans the given peer from the overlay.
Returns true if the peer was not already banned.
Sourcepub fn unban_peer(&self, peer_id: &PeerId) -> bool
pub fn unban_peer(&self, peer_id: &PeerId) -> bool
Unbans the given peer from the overlay.
Returns true if the peer was banned.
pub fn read_entries(&self) -> PublicOverlayEntriesReadGuard<'_>
Sourcepub fn entires_added(&self) -> &Notify
pub fn entires_added(&self) -> &Notify
Notifies when new entries are added to the overlay.
Sourcepub fn entries_changed(&self) -> &Notify
pub fn entries_changed(&self) -> &Notify
Notifies when entries are updated in the overlay (added or updated).
pub fn entries_removed(&self) -> &Notify
Sourcepub fn own_signed_entry(&self) -> Option<Arc<PublicEntry>>
pub fn own_signed_entry(&self) -> Option<Arc<PublicEntry>>
Own signed public entry.
Trait Implementations§
Source§impl Clone for PublicOverlay
impl Clone for PublicOverlay
Source§fn clone(&self) -> PublicOverlay
fn clone(&self) -> PublicOverlay
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PublicOverlay
impl !RefUnwindSafe for PublicOverlay
impl Send for PublicOverlay
impl Sync for PublicOverlay
impl Unpin for PublicOverlay
impl !UnwindSafe for PublicOverlay
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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