Struct libp2p_ping::protocol::Ping
source · pub struct Ping<TUserData = ()>(_);
Expand description
Represents a prototype for an upgrade to handle the ping protocol.
According to the design of libp2p, this struct would normally contain the configuration options
for the protocol, but in the case of Ping
no configuration is required.
Trait Implementations§
source§impl<TSocket, TUserData> InboundUpgrade<TSocket> for Ping<TUserData>where
TSocket: AsyncRead + AsyncWrite,
impl<TSocket, TUserData> InboundUpgrade<TSocket> for Ping<TUserData>where
TSocket: AsyncRead + AsyncWrite,
§type Output = PingListener<TSocket>
type Output = PingListener<TSocket>
Output after the upgrade has been successfully negotiated and the handshake performed.
§type Future = FutureResult<<Ping<TUserData> as InboundUpgrade<TSocket>>::Output, <Ping<TUserData> as InboundUpgrade<TSocket>>::Error>
type Future = FutureResult<<Ping<TUserData> as InboundUpgrade<TSocket>>::Output, <Ping<TUserData> as InboundUpgrade<TSocket>>::Error>
Future that performs the handshake with the remote.
source§impl<TSocket, TUserData> OutboundUpgrade<TSocket> for Ping<TUserData>where
TSocket: AsyncRead + AsyncWrite,
impl<TSocket, TUserData> OutboundUpgrade<TSocket> for Ping<TUserData>where
TSocket: AsyncRead + AsyncWrite,
§type Output = PingDialer<TSocket, TUserData>
type Output = PingDialer<TSocket, TUserData>
Output after the upgrade has been successfully negotiated and the handshake performed.
§type Future = FutureResult<<Ping<TUserData> as OutboundUpgrade<TSocket>>::Output, <Ping<TUserData> as OutboundUpgrade<TSocket>>::Error>
type Future = FutureResult<<Ping<TUserData> as OutboundUpgrade<TSocket>>::Output, <Ping<TUserData> as OutboundUpgrade<TSocket>>::Error>
Future that performs the handshake with the remote.
source§impl<TUserData> UpgradeInfo for Ping<TUserData>
impl<TUserData> UpgradeInfo for Ping<TUserData>
source§fn protocol_info(&self) -> Self::InfoIter
fn protocol_info(&self) -> Self::InfoIter
Returns the list of protocols that are supported. Used during the negotiation process.
impl<TUserData: Copy> Copy for Ping<TUserData>
Auto Trait Implementations§
impl<TUserData> RefUnwindSafe for Ping<TUserData>where
TUserData: RefUnwindSafe,
impl<TUserData> Send for Ping<TUserData>where
TUserData: Send,
impl<TUserData> Sync for Ping<TUserData>where
TUserData: Sync,
impl<TUserData> Unpin for Ping<TUserData>where
TUserData: Unpin,
impl<TUserData> UnwindSafe for Ping<TUserData>where
TUserData: UnwindSafe,
Blanket Implementations§
source§impl<C, U> InboundUpgradeExt<C> for Uwhere
U: InboundUpgrade<C>,
impl<C, U> InboundUpgradeExt<C> for Uwhere
U: InboundUpgrade<C>,
source§fn map_inbound<F, T>(self, f: F) -> MapInboundUpgrade<Self, F>where
Self: Sized,
F: FnOnce(Self::Output) -> T,
fn map_inbound<F, T>(self, f: F) -> MapInboundUpgrade<Self, F>where
Self: Sized,
F: FnOnce(Self::Output) -> T,
Returns a new object that wraps around
Self
and applies a closure to the Output
.source§fn map_inbound_err<F, T>(self, f: F) -> MapInboundUpgradeErr<Self, F>where
Self: Sized,
F: FnOnce(Self::Error) -> T,
fn map_inbound_err<F, T>(self, f: F) -> MapInboundUpgradeErr<Self, F>where
Self: Sized,
F: FnOnce(Self::Error) -> T,
Returns a new object that wraps around
Self
and applies a closure to the Error
.source§impl<C, U> OutboundUpgradeExt<C> for Uwhere
U: OutboundUpgrade<C>,
impl<C, U> OutboundUpgradeExt<C> for Uwhere
U: OutboundUpgrade<C>,
source§fn map_outbound<F, T>(self, f: F) -> MapOutboundUpgrade<Self, F>where
Self: Sized,
F: FnOnce(Self::Output) -> T,
fn map_outbound<F, T>(self, f: F) -> MapOutboundUpgrade<Self, F>where
Self: Sized,
F: FnOnce(Self::Output) -> T,
Returns a new object that wraps around
Self
and applies a closure to the Output
.source§fn map_outbound_err<F, T>(self, f: F) -> MapOutboundUpgradeErr<Self, F>where
Self: Sized,
F: FnOnce(Self::Error) -> T,
fn map_outbound_err<F, T>(self, f: F) -> MapOutboundUpgradeErr<Self, F>where
Self: Sized,
F: FnOnce(Self::Error) -> T,
Returns a new object that wraps around
Self
and applies a closure to the Error
.