[][src]Struct snarkos_network::protocol::ping_protocol::PingProtocol

pub struct PingProtocol { /* fields omitted */ }

Maintain connected peers.

  1. The server sends a Ping message to a peer.
  2. The peer responds with a Pong message.
  3. The server verifies the Pong message and updates the peer's last seen date

Implementations

impl PingProtocol[src]

pub async fn send(channel: Arc<Channel>) -> Result<Self, PingProtocolError>[src]

Send the initial ping message to a peer.

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

Receive the initial ping message from a peer. Respond with a pong.

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

Accept the pong from a peer.

pub fn get_state(&self) -> PingState[src]

Returns current ping protocol state.

Trait Implementations

impl Clone for PingProtocol[src]

impl Debug for PingProtocol[src]

Auto Trait Implementations

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>,