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) -> Selfwhere
Request: From<T>,
pub fn add<T>(self, other: T) -> Selfwhere
Request: From<T>,
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>) -> Selfwhere
Request: From<T>,
pub fn extend<T>(self, other: impl IntoIterator<Item = T>) -> Selfwhere
Request: From<T>,
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<Request> for Request
impl PartialEq<Request> for Request
source§impl Service<Request> for Client
impl Service<Request> for Client
§type Future<'f> = Either<CommandResult, Ready<Response, Error>>
type Future<'f> = Either<CommandResult, Ready<Response, Error>>
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