Enum ntex_redis::codec::Request
source · pub enum Request {
Array(Vec<Request>),
BulkString(BulkString),
BulkStatic(&'static [u8]),
BulkInteger(i64),
String(ByteString),
Integer(i64),
}
Expand description
A single RESP value, this owns the data that is to-be written to Redis.
It is cloneable to allow multiple copies to be delivered in certain circumstances, e.g. multiple subscribers to the same topic.
Variants§
Array(Vec<Request>)
Zero, one or more other Reqeests
s.
BulkString(BulkString)
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.
BulkStatic(&'static [u8])
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.
BulkInteger(i64)
Convert integer to string representation.
String(ByteString)
A valid utf-8 string
Integer(i64)
Redis documentation defines an integer as being a signed 64-bit integer: https://redis.io/topics/protocol#resp-integers
Implementations§
source§impl Request
impl Request
sourcepub fn from_static(data: &'static str) -> Self
pub fn from_static(data: &'static str) -> Self
Create request from static str
sourcepub fn from_bstatic(data: &'static [u8]) -> Self
pub fn from_bstatic(data: &'static [u8]) -> Self
Create request from static str
sourcepub fn add<T>(self, other: T) -> Self
pub fn add<T>(self, other: T) -> Self
Convenience function for building dynamic Redis commands with variable numbers of arguments, e.g. RPUSH
Self get converted to array if it is not an array.
sourcepub fn extend<T>(self, other: impl IntoIterator<Item = T>) -> Self
pub fn extend<T>(self, other: impl IntoIterator<Item = T>) -> Self
Convenience function for building dynamic Redis commands with variable numbers of arguments, e.g. RPUSH
Self get converted to array if it is not an array.
Trait Implementations§
source§impl PartialEq for Request
impl PartialEq for Request
source§impl Service<Request> for Client
impl Service<Request> for Client
source§fn poll_ready(&self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn poll_ready(&self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Ready
when the service is able to process requests. Read more