Enum ntex_redis::codec::Request[][src]

pub enum Request {
    Array(Vec<Request>),
    BulkString(BulkString),
    BulkStatic(&'static [u8]),
    BulkInteger(i64),
    String(ByteString),
    Integer(i64),
}

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 Reqeestss.

BulkString(BulkString)

A bulk string. In Redis terminology a string is a byte-array, so this is stored as a vector of u8s 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 u8s 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

impl Request[src]

pub fn from_static(data: &'static str) -> Self[src]

Create request from static str

pub fn from_bstatic(data: &'static [u8]) -> Self[src]

Create request from static str

pub fn add<T>(self, other: T) -> Self where
    Request: From<T>, 
[src]

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.

pub fn extend<T>(self, other: impl IntoIterator<Item = T>) -> Self where
    Request: From<T>, 
[src]

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

impl Clone for Request[src]

impl Debug for Request[src]

impl Eq for Request[src]

impl<T> From<T> for Request where
    BulkString: From<T>, 
[src]

impl From<i16> for Request[src]

impl From<i32> for Request[src]

impl From<i64> for Request[src]

impl From<i8> for Request[src]

impl From<u16> for Request[src]

impl From<u32> for Request[src]

impl From<u8> for Request[src]

impl From<usize> for Request[src]

impl Hash for Request[src]

impl PartialEq<Request> for Request[src]

impl StructuralEq for Request[src]

impl StructuralPartialEq for Request[src]

Auto Trait Implementations

impl RefUnwindSafe for Request

impl Send for Request

impl Sync for Request

impl Unpin for Request

impl UnwindSafe for Request

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CallHasher for T where
    T: Hash + ?Sized

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,