mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-12 17:41:22 +00:00
Fix the Default implementation of Ping (#501)
This commit is contained in:
@ -105,9 +105,16 @@ use tokio_io::{AsyncRead, AsyncWrite};
|
||||
///
|
||||
/// 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.
|
||||
#[derive(Debug, Copy, Clone, Default)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct Ping<TUserData = ()>(PhantomData<TUserData>);
|
||||
|
||||
impl<TUserData> Default for Ping<TUserData> {
|
||||
#[inline]
|
||||
fn default() -> Self {
|
||||
Ping(PhantomData)
|
||||
}
|
||||
}
|
||||
|
||||
/// Output of a `Ping` upgrade.
|
||||
pub enum PingOutput<TSocket, TUserData> {
|
||||
/// We are on the dialing side.
|
||||
|
Reference in New Issue
Block a user