pub enum Response {
Pong,
Error,
}Expand description
A PING protocol response.
Variants§
Implementations§
Source§impl Response
impl Response
Sourcepub fn parse(data: &[u8]) -> Result<(Self, usize), ParseError>
pub fn parse(data: &[u8]) -> Result<(Self, usize), ParseError>
Parse a response from the buffer.
Returns the parsed response and number of bytes consumed, or an error.
Accepts both simple ASCII PONG\r\n and RESP-style +PONG\r\n.
Trait Implementations§
impl Copy for Response
impl Eq for Response
impl StructuralPartialEq for Response
Auto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnsafeUnpin for Response
impl UnwindSafe for Response
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