pub struct PingProtocol { /* private fields */ }Expand description
The ping protocol for use with iroh::protocol::Router.
Implementations§
Source§impl PingProtocol
impl PingProtocol
Sourcepub fn metrics(&self) -> &Arc<PingMetrics>
pub fn metrics(&self) -> &Arc<PingMetrics>
Returns a handle to the ping metrics.
Trait Implementations§
Source§impl Clone for PingProtocol
impl Clone for PingProtocol
Source§fn clone(&self) -> PingProtocol
fn clone(&self) -> PingProtocol
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PingProtocol
impl Debug for PingProtocol
Source§impl Default for PingProtocol
impl Default for PingProtocol
Source§impl ProtocolHandler for PingProtocol
impl ProtocolHandler for PingProtocol
Source§async fn accept(&self, connection: Connection) -> Result<(), AcceptError>
async fn accept(&self, connection: Connection) -> Result<(), AcceptError>
Each incoming connection for our ALPN results in a call to accept.
The returned future runs on a newly spawned Tokio task, so it can run indefinitely as long as the connection remains open.
Source§fn on_accepting(
&self,
accepting: Accepting,
) -> impl Future<Output = Result<Connection, AcceptError>> + Send
fn on_accepting( &self, accepting: Accepting, ) -> impl Future<Output = Result<Connection, AcceptError>> + Send
Optional interception point to handle the
Accepting state. Read moreAuto Trait Implementations§
impl Freeze for PingProtocol
impl RefUnwindSafe for PingProtocol
impl Send for PingProtocol
impl Sync for PingProtocol
impl Unpin for PingProtocol
impl UnsafeUnpin for PingProtocol
impl UnwindSafe for PingProtocol
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<P> DynProtocolHandler for Pwhere
P: ProtocolHandler,
impl<P> DynProtocolHandler for Pwhere
P: ProtocolHandler,
Source§fn accept(
&self,
connection: Connection,
) -> Pin<Box<dyn Future<Output = Result<(), AcceptError>> + Send + '_>>
fn accept( &self, connection: Connection, ) -> Pin<Box<dyn Future<Output = Result<(), AcceptError>> + Send + '_>>
Source§fn on_accepting(
&self,
accepting: Accepting,
) -> Pin<Box<dyn Future<Output = Result<Connection, AcceptError>> + Send + '_>>
fn on_accepting( &self, accepting: Accepting, ) -> Pin<Box<dyn Future<Output = Result<Connection, AcceptError>> + Send + '_>>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more