pub enum Role {
Primary {
replication_offset: u64,
replicas: Vec<ReplicaInfo>,
},
Replica {
primary_ip: String,
primary_port: u16,
replication_state: String,
data_received: u64,
},
Sentinel {
primary_names: Vec<String>,
},
}
Expand description
High level representation of response to the ROLE
command.
Variants§
Primary
Represents a primary role, which is master
in legacy Redis terminology.
Fields
§
replicas: Vec<ReplicaInfo>
List of replica, each represented by a tuple of IP, port and the last acknowledged replication offset.
Replica
Represents a replica role, which is slave
in legacy Redis terminology.
Fields
Sentinel
Represents a sentinel role.
Trait Implementations§
Source§impl FromRedisValue for Role
impl FromRedisValue for Role
Source§fn from_redis_value(v: &Value) -> RedisResult<Self>
fn from_redis_value(v: &Value) -> RedisResult<Self>
Given a redis
Value
this attempts to convert it into the given
destination type. If that fails because it’s not compatible an
appropriate error is generated.Source§fn from_owned_redis_value(v: Value) -> RedisResult<Self>
fn from_owned_redis_value(v: Value) -> RedisResult<Self>
Given a redis
Value
this attempts to convert it into the given
destination type. If that fails because it’s not compatible an
appropriate error is generated.Source§fn from_redis_values(items: &[Value]) -> RedisResult<Vec<Self>>
fn from_redis_values(items: &[Value]) -> RedisResult<Vec<Self>>
Similar to
from_redis_value
but constructs a vector of objects
from another vector of values. This primarily exists internally
to customize the behavior for vectors of tuples.Source§fn from_owned_redis_values(items: Vec<Value>) -> RedisResult<Vec<Self>>
fn from_owned_redis_values(items: Vec<Value>) -> RedisResult<Vec<Self>>
The same as
from_redis_values
, but takes a Vec<Value>
instead
of a &[Value]
.Source§fn from_owned_byte_vec(_vec: Vec<u8>) -> RedisResult<Vec<Self>>
fn from_owned_byte_vec(_vec: Vec<u8>) -> RedisResult<Vec<Self>>
Convert bytes to a single element vector.
impl Eq for Role
impl StructuralPartialEq for Role
Auto Trait Implementations§
impl Freeze for Role
impl RefUnwindSafe for Role
impl Send for Role
impl Sync for Role
impl Unpin for Role
impl UnwindSafe for Role
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more