pub enum Response {
Nil,
Array(Vec<Response>),
Bytes(Bytes),
String(ByteString),
Error(ByteString),
Integer(i64),
}
Expand description
A single RESP value, this owns the data that is read from Redis.
Variants§
Nil
Array(Vec<Response>)
Zero, one or more other Response
s.
Bytes(Bytes)
A bulk string. In Redis terminology a string is a byte-array, so this is stored as a
vector of u8
s to allow clients to interpret the bytes as appropriate.
String(ByteString)
A valid utf-8 string
Error(ByteString)
An error from the Redis server
Integer(i64)
Redis documentation defines an integer as being a signed 64-bit integer: https://redis.io/topics/protocol#resp-integers
Implementations§
Source§impl Response
impl Response
Sourcepub fn into_result(self) -> Result<Response, ByteString>
pub fn into_result(self) -> Result<Response, ByteString>
Extract redis server error to Result
Trait Implementations§
Source§impl TryFrom<Response> for ByteString
impl TryFrom<Response> for ByteString
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 !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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more