Lines Matching full:ping
9 pub struct Ping { struct
15 // zeroes to distinguish this specific PING from any other.
19 impl Ping { argument
32 pub fn new(payload: Payload) -> Ping { in new() argument
33 Ping { in new()
39 pub fn pong(payload: Payload) -> Ping { in pong() argument
40 Ping { ack: true, payload } in pong()
55 /// Builds a `Ping` frame from a raw frame.
56 pub fn load(head: Head, bytes: &[u8]) -> Result<Ping, Error> { in load() argument
57 debug_assert_eq!(head.kind(), crate::frame::Kind::Ping); in load()
59 // PING frames are not associated with any individual stream. If a PING in load()
67 // In addition to the frame header, PING frames MUST contain 8 octets of opaque in load()
76 // The PING frame defines the following flags: in load()
78 // ACK (0x1): When set, bit 0 indicates that this PING frame is a PING in load()
79 // response. An endpoint MUST set this flag in PING responses. An in load()
80 // endpoint MUST NOT respond to PING frames containing this flag. in load()
83 Ok(Ping { ack, payload }) in load()
88 tracing::trace!("encoding PING; ack={} len={}", self.ack, sz); in encode()
91 let head = Head::new(Kind::Ping, flags, StreamId::zero()); in encode()
98 impl<T> From<Ping> for Frame<T> {
99 fn from(src: Ping) -> Frame<T> { in from()
100 Frame::Ping(src) in from()