Enum rustis::commands::RequestPolicy

source ·
pub enum RequestPolicy {
    AllNodes,
    AllShards,
    MultiShard,
    Special,
}
Expand description

This tip can help clients determine the shards to send the command in clustering mode.

The default behavior a client should implement for commands without the request_policy tip is as follows:

  1. The command doesn’t accept key name arguments: the client can execute the command on an arbitrary shard.
  2. For commands that accept one or more key name arguments: the client should route the command to a single shard, as determined by the hash slot of the input keys.

Variants§

§

AllNodes

the client should execute the command on all nodes - masters and replicas alike.

An example is the config_set command. This tip is in-use by commands that don’t accept key name arguments. The command operates atomically per shard.

§

AllShards

the client should execute the command on all master shards (e.g., the dbsize command).

This tip is in-use by commands that don’t accept key name arguments. The command operates atomically per shard.

§

MultiShard

the client should execute the command on several shards.

The shards that execute the command are determined by the hash slots of its input key name arguments. Examples for such commands include mset, mget and del. However, note that sunionstore isn’t considered as multi_shard because all of its keys must belong to the same hash slot.

§

Special

indicates a non-trivial form of the client’s request policy, such as the scan command.

Trait Implementations§

source§

impl Clone for RequestPolicy

source§

fn clone(&self) -> RequestPolicy

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for RequestPolicy

source§

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

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for RequestPolicy

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl FromStr for RequestPolicy

§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(str: &str) -> Result<Self>

Parses a string s to return a value of this type. 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, 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> ToOwned for T
where T: Clone,

§

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>,

§

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>,

§

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> Response for T