pub enum ClusterError {
SlotNotAssigned(u16),
Moved {
slot: u16,
addr: SocketAddr,
},
Ask {
slot: u16,
addr: SocketAddr,
},
NodeNotFound(NodeId),
ClusterDown,
WrongRole {
role: String,
},
CrossSlot(u16, u16),
Network(String),
Timeout,
Configuration(String),
}Expand description
Errors that can occur during cluster operations.
Variants§
SlotNotAssigned(u16)
The slot is not assigned to any node.
Moved
The key belongs to a slot on a different node.
Ask
The slot is being migrated; client should retry with ASK.
NodeNotFound(NodeId)
Node not found in the cluster.
ClusterDown
Cluster is not in a healthy state.
WrongRole
Operation requires a different node role.
CrossSlot(u16, u16)
Cross-slot operation with keys in different slots.
Network(String)
Network error during cluster communication.
Timeout
Timeout waiting for cluster operation.
Configuration(String)
Configuration error.
Implementations§
Source§impl ClusterError
impl ClusterError
Sourcepub fn is_redirect(&self) -> bool
pub fn is_redirect(&self) -> bool
Returns true if this is a redirect error (MOVED or ASK).
Sourcepub fn moved(slot: u16, addr: SocketAddr) -> Self
pub fn moved(slot: u16, addr: SocketAddr) -> Self
Creates a MOVED error for a slot redirect.
Sourcepub fn ask(slot: u16, addr: SocketAddr) -> Self
pub fn ask(slot: u16, addr: SocketAddr) -> Self
Creates an ASK error for a slot migration redirect.
Trait Implementations§
Source§impl Debug for ClusterError
impl Debug for ClusterError
Source§impl Display for ClusterError
impl Display for ClusterError
Source§impl Error for ClusterError
impl Error for ClusterError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ClusterError
impl RefUnwindSafe for ClusterError
impl Send for ClusterError
impl Sync for ClusterError
impl Unpin for ClusterError
impl UnsafeUnpin for ClusterError
impl UnwindSafe for ClusterError
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