pub enum CommandResponse {
Ok,
Nil,
Integer(i64),
BulkString(Vec<u8>),
BulkStringShared(Arc<[u8]>),
SimpleString(String),
Array(Vec<CommandResponse>),
Error(String),
Map(Vec<(CommandResponse, CommandResponse)>),
Set(Vec<CommandResponse>),
Double(f64),
Boolean(bool),
}Expand description
Response from executing a command on a shard.
Variants§
Ok
+OK
Nil
Null bulk string ($-1)
Integer(i64)
Integer reply
BulkString(Vec<u8>)
Bulk string
Bulk string backed by shared bytes to avoid copying large values on reads.
SimpleString(String)
Simple string (without the +)
Array(Vec<CommandResponse>)
Array of responses
Error(String)
Error message
Map(Vec<(CommandResponse, CommandResponse)>)
RESP3 Map (key-value pairs)
Set(Vec<CommandResponse>)
RESP3 Set (unique values)
Double(f64)
RESP3 Double (floating-point)
Boolean(bool)
RESP3 Boolean
Implementations§
Source§impl CommandResponse
impl CommandResponse
Sourcepub fn bulk_string_bytes(&self) -> Option<&[u8]>
pub fn bulk_string_bytes(&self) -> Option<&[u8]>
Returns the bulk-string payload if this response contains one.
Sourcepub fn into_bulk_string_bytes(self) -> Option<Vec<u8>>
pub fn into_bulk_string_bytes(self) -> Option<Vec<u8>>
Consumes the response and returns an owned bulk-string payload when present.
Trait Implementations§
Source§impl Clone for CommandResponse
impl Clone for CommandResponse
Source§fn clone(&self) -> CommandResponse
fn clone(&self) -> CommandResponse
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommandResponse
impl Debug for CommandResponse
Source§impl PartialEq for CommandResponse
impl PartialEq for CommandResponse
impl StructuralPartialEq for CommandResponse
Auto Trait Implementations§
impl Freeze for CommandResponse
impl RefUnwindSafe for CommandResponse
impl Send for CommandResponse
impl Sync for CommandResponse
impl Unpin for CommandResponse
impl UnsafeUnpin for CommandResponse
impl UnwindSafe for CommandResponse
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