[−][src]Struct snarkos_network::context::pings::Pings
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]
&'_ mut self,
channel: Arc<Channel>
) -> Result<(), PingProtocolError>
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]
message: Ping,
channel: Arc<Channel>
) -> Result<(), PingProtocolError>
Send a pong response to a ping request.
pub async fn accept_pong<'_>(
&'_ mut self,
peer_address: SocketAddr,
message: Pong
) -> Result<(), PingProtocolError>
[src]
&'_ mut self,
peer_address: SocketAddr,
message: Pong
) -> Result<(), PingProtocolError>
Accept a pong response.
pub fn get_state(&self, address: SocketAddr) -> Option<PingState>
[src]
Returns ping state for current peer.
Trait Implementations
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,