Enum redis::cluster_routing::ResponsePolicy
source · pub enum ResponsePolicy {
OneSucceeded,
OneSucceededNonEmpty,
AllSucceeded,
AggregateLogical(LogicalAggregateOp),
Aggregate(AggregateOp),
CombineArrays,
Special,
}
Expand description
Policy defining how to combine multiple responses into one.
Variants§
OneSucceeded
Wait for one request to succeed and return its results. Return error if all requests fail.
OneSucceededNonEmpty
Wait for one request to succeed with a non-empty value. Return error if all requests fail or return Nil
.
AllSucceeded
Waits for all requests to succeed, and the returns one of the successes. Returns the error on the first received error.
AggregateLogical(LogicalAggregateOp)
Aggregate success results according to a logical bitwise operator. Return error on any failed request or on a response that doesn’t conform to 0 or 1.
Aggregate(AggregateOp)
Aggregate success results according to a numeric operator. Return error on any failed request or on a response that isn’t an integer.
CombineArrays
Aggregate array responses into a single array. Return error on any failed request or on a response that isn’t an array.
Special
Handling is not defined by the Redis standard. Will receive a special case
Implementations§
source§impl ResponsePolicy
impl ResponsePolicy
sourcepub fn for_command(cmd: &[u8]) -> Option<ResponsePolicy>
pub fn for_command(cmd: &[u8]) -> Option<ResponsePolicy>
Parse the command for the matching response policy.
Trait Implementations§
source§impl Clone for ResponsePolicy
impl Clone for ResponsePolicy
source§fn clone(&self) -> ResponsePolicy
fn clone(&self) -> ResponsePolicy
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ResponsePolicy
impl Debug for ResponsePolicy
source§impl PartialEq for ResponsePolicy
impl PartialEq for ResponsePolicy
source§fn eq(&self, other: &ResponsePolicy) -> bool
fn eq(&self, other: &ResponsePolicy) -> bool
self
and other
values to be equal, and is used
by ==
.