pub(crate) struct PingPong {
pending_ping: Option<PendingPing>,
pending_pong: Option<[u8; 8]>,
user_pings: Option<UserPingsRx>,
}
Expand description
Acknowledges ping requests from the remote.
Fields§
§pending_ping: Option<PendingPing>
§pending_pong: Option<[u8; 8]>
§user_pings: Option<UserPingsRx>
Implementations§
source§impl PingPong
impl PingPong
pub(crate) fn new() -> Self
sourcepub(crate) fn take_user_pings(&mut self) -> Option<UserPings>
pub(crate) fn take_user_pings(&mut self) -> Option<UserPings>
Can only be called once. If called a second time, returns None
.
pub(crate) fn ping_shutdown(&mut self)
sourcepub(crate) fn recv_ping(&mut self, ping: Ping) -> ReceivedPing
pub(crate) fn recv_ping(&mut self, ping: Ping) -> ReceivedPing
Process a ping
sourcepub(crate) fn send_pending_pong<T, B>(
&mut self,
cx: &mut Context<'_>,
dst: &mut Codec<T, B>
) -> Poll<Result<()>>where
T: AsyncWrite + Unpin,
B: Buf,
pub(crate) fn send_pending_pong<T, B>( &mut self, cx: &mut Context<'_>, dst: &mut Codec<T, B> ) -> Poll<Result<()>>where T: AsyncWrite + Unpin, B: Buf,
Send any pending pongs.
sourcepub(crate) fn send_pending_ping<T, B>(
&mut self,
cx: &mut Context<'_>,
dst: &mut Codec<T, B>
) -> Poll<Result<()>>where
T: AsyncWrite + Unpin,
B: Buf,
pub(crate) fn send_pending_ping<T, B>( &mut self, cx: &mut Context<'_>, dst: &mut Codec<T, B> ) -> Poll<Result<()>>where T: AsyncWrite + Unpin, B: Buf,
Send any pending pings.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PingPong
impl Send for PingPong
impl Sync for PingPong
impl Unpin for PingPong
impl !UnwindSafe for PingPong
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