Skip to main content

ShardRequest

Enum ShardRequest 

Source
pub enum ShardRequest {
Show 95 variants Get { key: String, }, Set { key: String, value: Bytes, expire: Option<Duration>, nx: bool, xx: bool, }, Incr { key: String, }, Decr { key: String, }, IncrBy { key: String, delta: i64, }, DecrBy { key: String, delta: i64, }, IncrByFloat { key: String, delta: f64, }, Append { key: String, value: Bytes, }, Strlen { key: String, }, GetRange { key: String, start: i64, end: i64, }, SetRange { key: String, offset: usize, value: Bytes, }, Keys { pattern: String, }, Rename { key: String, newkey: String, }, Copy { source: String, destination: String, replace: bool, }, ObjectEncoding { key: String, }, Del { key: String, }, Unlink { key: String, }, Exists { key: String, }, RandomKey, Touch { key: String, }, Sort { key: String, desc: bool, alpha: bool, limit: Option<(i64, i64)>, }, Expire { key: String, seconds: u64, }, Ttl { key: String, }, Persist { key: String, }, Pttl { key: String, }, Pexpire { key: String, milliseconds: u64, }, LPush { key: String, values: Vec<Bytes>, }, RPush { key: String, values: Vec<Bytes>, }, LPop { key: String, }, RPop { key: String, }, BLPop { key: String, waiter: Sender<(String, Bytes)>, }, BRPop { key: String, waiter: Sender<(String, Bytes)>, }, LRange { key: String, start: i64, stop: i64, }, LLen { key: String, }, LIndex { key: String, index: i64, }, LSet { key: String, index: i64, value: Bytes, }, LTrim { key: String, start: i64, stop: i64, }, LInsert { key: String, before: bool, pivot: Bytes, value: Bytes, }, LRem { key: String, count: i64, value: Bytes, }, LPos { key: String, element: Bytes, rank: i64, count: usize, maxlen: usize, }, Type { key: String, }, ZAdd { key: String, members: Vec<(f64, String)>, nx: bool, xx: bool, gt: bool, lt: bool, ch: bool, }, ZRem { key: String, members: Vec<String>, }, ZScore { key: String, member: String, }, ZRank { key: String, member: String, }, ZRevRank { key: String, member: String, }, ZCard { key: String, }, ZRange { key: String, start: i64, stop: i64, with_scores: bool, }, ZRevRange { key: String, start: i64, stop: i64, with_scores: bool, }, ZCount { key: String, min: ScoreBound, max: ScoreBound, }, ZIncrBy { key: String, increment: f64, member: String, }, ZRangeByScore { key: String, min: ScoreBound, max: ScoreBound, offset: usize, count: Option<usize>, }, ZRevRangeByScore { key: String, min: ScoreBound, max: ScoreBound, offset: usize, count: Option<usize>, }, ZPopMin { key: String, count: usize, }, ZPopMax { key: String, count: usize, }, HSet { key: String, fields: Vec<(String, Bytes)>, }, HGet { key: String, field: String, }, HGetAll { key: String, }, HDel { key: String, fields: Vec<String>, }, HExists { key: String, field: String, }, HLen { key: String, }, HIncrBy { key: String, field: String, delta: i64, }, HKeys { key: String, }, HVals { key: String, }, HMGet { key: String, fields: Vec<String>, }, SAdd { key: String, members: Vec<String>, }, SRem { key: String, members: Vec<String>, }, SMembers { key: String, }, SIsMember { key: String, member: String, }, SCard { key: String, }, SUnion { keys: Vec<String>, }, SInter { keys: Vec<String>, }, SDiff { keys: Vec<String>, }, SUnionStore { dest: String, keys: Vec<String>, }, SInterStore { dest: String, keys: Vec<String>, }, SDiffStore { dest: String, keys: Vec<String>, }, SRandMember { key: String, count: i64, }, SPop { key: String, count: usize, }, SMisMember { key: String, members: Vec<String>, }, DbSize, Stats, KeyVersion { key: String, }, Snapshot, SerializeSnapshot, RewriteAof, FlushDb, FlushDbAsync, Scan { cursor: u64, count: usize, pattern: Option<String>, }, SScan { key: String, cursor: u64, count: usize, pattern: Option<String>, }, HScan { key: String, cursor: u64, count: usize, pattern: Option<String>, }, ZScan { key: String, cursor: u64, count: usize, pattern: Option<String>, }, CountKeysInSlot { slot: u16, }, GetKeysInSlot { slot: u16, count: usize, }, DumpKey { key: String, }, RestoreKey { key: String, ttl_ms: u64, data: Bytes, replace: bool, },
}
Expand description

A protocol-agnostic command sent to a shard.

Variants§

§

Get

Fields

§

Set

Fields

§value: Bytes
§nx: bool

Only set the key if it does not already exist.

§xx: bool

Only set the key if it already exists.

§

Incr

Fields

§

Decr

Fields

§

IncrBy

Fields

§delta: i64
§

DecrBy

Fields

§delta: i64
§

IncrByFloat

Fields

§delta: f64
§

Append

Fields

§value: Bytes
§

Strlen

Fields

§

GetRange

Fields

§start: i64
§end: i64
§

SetRange

Fields

§offset: usize
§value: Bytes
§

Keys

Returns all keys matching a glob pattern in this shard.

Fields

§pattern: String
§

Rename

Renames a key within this shard.

Fields

§newkey: String
§

Copy

Copies the value at source to destination within this shard.

Fields

§source: String
§destination: String
§replace: bool
§

ObjectEncoding

Returns the internal encoding name for the value at key.

Fields

§

Del

Fields

Like DEL but defers value deallocation to the background drop thread.

Fields

§

Exists

Fields

§

RandomKey

Returns a random key from the shard’s keyspace.

§

Touch

Updates last access time for a key. Returns bool (existed).

Fields

§

Sort

Sorts elements from a list, set, or sorted set in this shard.

Fields

§desc: bool
§alpha: bool
§limit: Option<(i64, i64)>
§

Expire

Fields

§seconds: u64
§

Ttl

Fields

§

Persist

Fields

§

Pttl

Fields

§

Pexpire

Fields

§milliseconds: u64
§

LPush

Fields

§values: Vec<Bytes>
§

RPush

Fields

§values: Vec<Bytes>
§

LPop

Fields

§

RPop

Fields

§

BLPop

Blocking left-pop. If the list has elements, pops immediately and sends the result on waiter. If empty, the shard registers the waiter to be woken when an element is pushed. Uses an mpsc sender so multiple shards can race to deliver the first result to a single receiver.

Fields

§waiter: Sender<(String, Bytes)>
§

BRPop

Blocking right-pop. Same semantics as BLPop but pops from the tail.

Fields

§waiter: Sender<(String, Bytes)>
§

LRange

Fields

§start: i64
§stop: i64
§

LLen

Fields

§

LIndex

Fields

§index: i64
§

LSet

Fields

§index: i64
§value: Bytes
§

LTrim

Fields

§start: i64
§stop: i64
§

LInsert

Fields

§before: bool
§pivot: Bytes
§value: Bytes
§

LRem

Fields

§count: i64
§value: Bytes
§

LPos

Fields

§element: Bytes
§rank: i64
§count: usize
§maxlen: usize
§

Type

Fields

§

ZAdd

Fields

§members: Vec<(f64, String)>
§nx: bool
§xx: bool
§gt: bool
§lt: bool
§ch: bool
§

ZRem

Fields

§members: Vec<String>
§

ZScore

Fields

§member: String
§

ZRank

Fields

§member: String
§

ZRevRank

Fields

§member: String
§

ZCard

Fields

§

ZRange

Fields

§start: i64
§stop: i64
§with_scores: bool
§

ZRevRange

Fields

§start: i64
§stop: i64
§with_scores: bool
§

ZCount

§

ZIncrBy

Fields

§increment: f64
§member: String
§

ZRangeByScore

Fields

§offset: usize
§count: Option<usize>
§

ZRevRangeByScore

Fields

§offset: usize
§count: Option<usize>
§

ZPopMin

Fields

§count: usize
§

ZPopMax

Fields

§count: usize
§

HSet

Fields

§fields: Vec<(String, Bytes)>
§

HGet

Fields

§field: String
§

HGetAll

Fields

§

HDel

Fields

§fields: Vec<String>
§

HExists

Fields

§field: String
§

HLen

Fields

§

HIncrBy

Fields

§field: String
§delta: i64
§

HKeys

Fields

§

HVals

Fields

§

HMGet

Fields

§fields: Vec<String>
§

SAdd

Fields

§members: Vec<String>
§

SRem

Fields

§members: Vec<String>
§

SMembers

Fields

§

SIsMember

Fields

§member: String
§

SCard

Fields

§

SUnion

Fields

§keys: Vec<String>
§

SInter

Fields

§keys: Vec<String>
§

SDiff

Fields

§keys: Vec<String>
§

SUnionStore

Fields

§dest: String
§keys: Vec<String>
§

SInterStore

Fields

§dest: String
§keys: Vec<String>
§

SDiffStore

Fields

§dest: String
§keys: Vec<String>
§

SRandMember

Fields

§count: i64
§

SPop

Fields

§count: usize
§

SMisMember

Fields

§members: Vec<String>
§

DbSize

Returns the key count for this shard.

§

Stats

Returns keyspace stats for this shard.

§

KeyVersion

Returns the current version of a key for WATCH optimistic locking. Read-only, no AOF, no replication — cold path only.

Fields

§

Snapshot

Triggers a snapshot write.

§

SerializeSnapshot

Serializes the current shard state to bytes (in-memory snapshot).

Used by the replication server to capture a consistent shard snapshot for transmission to a new replica without filesystem I/O.

§

RewriteAof

Triggers an AOF rewrite (snapshot + truncate AOF).

§

FlushDb

Clears all keys from the keyspace.

§

FlushDbAsync

Clears all keys, deferring deallocation to the background drop thread.

§

Scan

Scans keys in the keyspace.

Fields

§cursor: u64
§count: usize
§pattern: Option<String>
§

SScan

Incrementally iterates set members.

Fields

§cursor: u64
§count: usize
§pattern: Option<String>
§

HScan

Incrementally iterates hash fields.

Fields

§cursor: u64
§count: usize
§pattern: Option<String>
§

ZScan

Incrementally iterates sorted set members.

Fields

§cursor: u64
§count: usize
§pattern: Option<String>
§

CountKeysInSlot

Counts keys in this shard that hash to the given cluster slot.

Fields

§slot: u16
§

GetKeysInSlot

Returns up to count keys that hash to the given cluster slot.

Fields

§slot: u16
§count: usize
§

DumpKey

Dumps a key’s value as serialized bytes for MIGRATE.

Fields

§

RestoreKey

Restores a key from serialized bytes (received via MIGRATE).

Fields

§ttl_ms: u64
§data: Bytes
§replace: bool

Trait Implementations§

Source§

impl Debug for ShardRequest

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> 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> 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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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
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
Source§

impl<T> OptionalSend for T
where T: Send + ?Sized,

Source§

impl<T> OptionalSync for T
where T: Sync + ?Sized,