implement client ping (#108)
This commit is contained in:
@@ -63,4 +63,17 @@ impl Ping {
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Converts the command into an equivalent `Frame`.
|
||||
///
|
||||
/// This is called by the client when encoding a `Ping` command to send
|
||||
/// to the server.
|
||||
pub(crate) fn into_frame(self) -> Frame {
|
||||
let mut frame = Frame::array();
|
||||
frame.push_bulk(Bytes::from("ping".as_bytes()));
|
||||
if let Some(msg) = self.msg {
|
||||
frame.push_bulk(Bytes::from(msg));
|
||||
}
|
||||
frame
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user