pub struct Ping {
ack: bool,
payload: [u8; 8],
}
Fields§
§ack: bool
§payload: [u8; 8]
Implementations§
source§impl Ping
impl Ping
pub(crate) const SHUTDOWN: [u8; 8] = SHUTDOWN_PAYLOAD
pub(crate) const USER: [u8; 8] = USER_PAYLOAD
pub fn new(payload: [u8; 8]) -> Ping
pub fn pong(payload: [u8; 8]) -> Ping
pub fn is_ack(&self) -> bool
pub fn payload(&self) -> &[u8; 8]
pub fn into_payload(self) -> [u8; 8]
sourcepub fn load(head: Head, bytes: &[u8]) -> Result<Ping, Error>
pub fn load(head: Head, bytes: &[u8]) -> Result<Ping, Error>
Builds a Ping
frame from a raw frame.
pub fn encode<B: BufMut>(&self, dst: &mut B)
Trait Implementations§
impl Eq for Ping
impl StructuralPartialEq for Ping
Auto Trait Implementations§
impl Freeze for Ping
impl RefUnwindSafe for Ping
impl Send for Ping
impl Sync for Ping
impl Unpin for Ping
impl UnwindSafe for Ping
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.