Enum ntex_redis::codec::Response
source · 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 PartialEq for Response
impl PartialEq for Response
source§impl TryFrom<Response> for ByteString
impl TryFrom<Response> for ByteString
source§impl TryFrom<Response> for SubscribeItem
impl TryFrom<Response> for SubscribeItem
impl Eq for Response
impl StructuralEq for Response
impl StructuralPartialEq for Response
Auto Trait Implementations§
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