pub struct PingPong { /* private fields */ }
Expand description
A handle to send and receive PING frames with the peer.
Implementations
sourceimpl PingPong
impl PingPong
sourcepub fn send_ping(&mut self, ping: Ping) -> Result<(), Error>
pub fn send_ping(&mut self, ping: Ping) -> Result<(), Error>
Send a PING
frame to the peer.
Only one ping can be pending at a time, so trying to send while a pong has not be received means this will return a user error.
Example
// let mut ping_pong = ...
ping_pong
.send_ping(h2::Ping::opaque())
.unwrap();
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more