[][src]Struct snarkos_network::context::pings::Pings

pub struct Pings { /* fields omitted */ }

Stores connected peers and the latest state of a ping/pong protocol.

Implementations

impl Pings[src]

pub fn new() -> Self[src]

Construct new store of connected peer Pings.

pub async fn send_ping<'_>(
    &'_ mut self,
    channel: Arc<Channel>
) -> Result<(), PingProtocolError>
[src]

Send a ping request to a peer. Store the result upon success.

pub async fn send_pong(
    message: Ping,
    channel: Arc<Channel>
) -> Result<(), PingProtocolError>
[src]

Send a pong response to a ping request.

pub async fn accept_pong<'_>(
    &'_ mut self,
    peer_address: SocketAddr,
    message: Pong
) -> Result<(), PingProtocolError>
[src]

Accept a pong response.

pub fn get_state(&self, address: SocketAddr) -> Option<PingState>[src]

Returns ping state for current peer.

Trait Implementations

impl Clone for Pings[src]

impl Debug for Pings[src]

Auto Trait Implementations

impl !RefUnwindSafe for Pings

impl Send for Pings

impl Sync for Pings

impl Unpin for Pings

impl !UnwindSafe for Pings

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,