Skip to main content

Command

Enum Command 

Source
pub enum Command {
Show 56 variants Get(Vec<u8>), Set { key: Vec<u8>, value: Bytes, ex: Option<u64>, px: Option<u64>, }, Del(Vec<Vec<u8>>), Exists(Vec<Vec<u8>>), Incr(Vec<u8>), IncrBy { key: Vec<u8>, delta: i64, }, Decr(Vec<u8>), DecrBy { key: Vec<u8>, delta: i64, }, Expire { key: Vec<u8>, seconds: u64, }, PExpire { key: Vec<u8>, milliseconds: u64, }, Ttl(Vec<u8>), PTtl(Vec<u8>), Persist(Vec<u8>), MGet(Vec<Vec<u8>>), MSet(Vec<(Vec<u8>, Bytes)>), Ping(Option<Bytes>), Echo(Bytes), Info(Option<String>), Config { action: String, args: Vec<Bytes>, }, Command { subcommand: Option<String>, args: Vec<Vec<u8>>, }, Quit, FlushDb, Keys(String), Scan { cursor: Vec<u8>, count: usize, pattern: Option<String>, }, JsonPatch { key: Vec<u8>, patch: Bytes, }, Cas { key: Vec<u8>, expected: Bytes, new_value: Bytes, }, Auth(Vec<u8>), LPush { key: Vec<u8>, values: Vec<Bytes>, }, RPush { key: Vec<u8>, values: Vec<Bytes>, }, LPop { key: Vec<u8>, count: Option<usize>, }, RPop { key: Vec<u8>, count: Option<usize>, }, LLen(Vec<u8>), LRange { key: Vec<u8>, start: i64, stop: i64, }, LIndex { key: Vec<u8>, index: i64, }, Subscribe(Vec<Vec<u8>>), Unsubscribe(Option<Vec<Vec<u8>>>), PSubscribe(Vec<Vec<u8>>), PUnsubscribe(Option<Vec<Vec<u8>>>), Publish { channel: Vec<u8>, message: Vec<u8>, }, PubSub { subcommand: String, args: Vec<Vec<u8>>, }, Client { subcommand: String, args: Vec<Vec<u8>>, }, Multi, Exec, Discard, Watch(Vec<Vec<u8>>), Unwatch, HSet { key: Vec<u8>, fields: Vec<(Vec<u8>, Bytes)>, }, HGet { key: Vec<u8>, field: Vec<u8>, }, HMGet { key: Vec<u8>, fields: Vec<Vec<u8>>, }, HDel { key: Vec<u8>, fields: Vec<Vec<u8>>, }, HExists { key: Vec<u8>, field: Vec<u8>, }, HGetAll(Vec<u8>), HLen(Vec<u8>), HKeys(Vec<u8>), HVals(Vec<u8>), HIncrBy { key: Vec<u8>, field: Vec<u8>, delta: i64, },
}

Variants§

§

Get(Vec<u8>)

§

Set

Fields

§key: Vec<u8>
§value: Bytes
§

Del(Vec<Vec<u8>>)

§

Exists(Vec<Vec<u8>>)

§

Incr(Vec<u8>)

§

IncrBy

Fields

§key: Vec<u8>
§delta: i64
§

Decr(Vec<u8>)

§

DecrBy

Fields

§key: Vec<u8>
§delta: i64
§

Expire

Fields

§key: Vec<u8>
§seconds: u64
§

PExpire

Fields

§key: Vec<u8>
§milliseconds: u64
§

Ttl(Vec<u8>)

§

PTtl(Vec<u8>)

§

Persist(Vec<u8>)

§

MGet(Vec<Vec<u8>>)

§

MSet(Vec<(Vec<u8>, Bytes)>)

§

Ping(Option<Bytes>)

§

Echo(Bytes)

§

Info(Option<String>)

§

Config

Fields

§action: String
§args: Vec<Bytes>
§

Command

Fields

§subcommand: Option<String>
§args: Vec<Vec<u8>>
§

Quit

§

FlushDb

§

Keys(String)

§

Scan

Fields

§cursor: Vec<u8>
§count: usize
§pattern: Option<String>
§

JsonPatch

Fields

§key: Vec<u8>
§patch: Bytes
§

Cas

Fields

§key: Vec<u8>
§expected: Bytes
§new_value: Bytes
§

Auth(Vec<u8>)

§

LPush

Fields

§key: Vec<u8>
§values: Vec<Bytes>
§

RPush

Fields

§key: Vec<u8>
§values: Vec<Bytes>
§

LPop

Fields

§key: Vec<u8>
§count: Option<usize>
§

RPop

Fields

§key: Vec<u8>
§count: Option<usize>
§

LLen(Vec<u8>)

§

LRange

Fields

§key: Vec<u8>
§start: i64
§stop: i64
§

LIndex

Fields

§key: Vec<u8>
§index: i64
§

Subscribe(Vec<Vec<u8>>)

§

Unsubscribe(Option<Vec<Vec<u8>>>)

§

PSubscribe(Vec<Vec<u8>>)

§

PUnsubscribe(Option<Vec<Vec<u8>>>)

§

Publish

Fields

§channel: Vec<u8>
§message: Vec<u8>
§

PubSub

Fields

§subcommand: String
§args: Vec<Vec<u8>>
§

Client

Fields

§subcommand: String
§args: Vec<Vec<u8>>
§

Multi

§

Exec

§

Discard

§

Watch(Vec<Vec<u8>>)

§

Unwatch

§

HSet

Fields

§key: Vec<u8>
§fields: Vec<(Vec<u8>, Bytes)>
§

HGet

Fields

§key: Vec<u8>
§field: Vec<u8>
§

HMGet

Fields

§key: Vec<u8>
§fields: Vec<Vec<u8>>
§

HDel

Fields

§key: Vec<u8>
§fields: Vec<Vec<u8>>
§

HExists

Fields

§key: Vec<u8>
§field: Vec<u8>
§

HGetAll(Vec<u8>)

§

HLen(Vec<u8>)

§

HKeys(Vec<u8>)

§

HVals(Vec<u8>)

§

HIncrBy

Fields

§key: Vec<u8>
§field: Vec<u8>
§delta: i64

Implementations§

Source§

impl Command

Source

pub fn from_resp(value: RespValue) -> Result<Self, String>

Parse command from RESP array

Source

pub fn is_pubsub_command(&self) -> bool

Check if this is a pub/sub command

Source

pub fn is_allowed_in_pubsub_mode(&self) -> bool

Check if this command is allowed in pub/sub mode

Source

pub fn to_pubsub_op(self) -> Option<PubSubOp>

Convert to PubSubOp if this is a pub/sub command

Trait Implementations§

Source§

impl Clone for Command

Source§

fn clone(&self) -> Command

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Command

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more