pub enum RedisError {
Show 15 variants
Io(Error),
Protocol(String),
Server(String),
Moved {
slot: u16,
host: String,
port: u16,
},
Ask {
slot: u16,
host: String,
port: u16,
},
Connection(String),
Timeout,
Type(String),
Config(String),
Cluster(String),
Sentinel(String),
Auth(String),
Pool(String),
MaxRetriesExceeded(usize),
UnexpectedResponse(String),
}Expand description
Comprehensive error type for Redis operations
Variants§
Io(Error)
IO error during network operations
Protocol(String)
Protocol parsing error
Server(String)
Server returned an error
Moved
MOVED redirect in cluster mode
Ask
ASK redirect in cluster mode
Connection(String)
Connection error
Timeout
Timeout error
Type(String)
Type conversion error
Config(String)
Invalid configuration
Cluster(String)
Cluster error
Sentinel(String)
Sentinel error
Auth(String)
Authentication error
Pool(String)
Pool error
MaxRetriesExceeded(usize)
Maximum retry attempts exceeded
UnexpectedResponse(String)
Unexpected response from server
Implementations§
Source§impl RedisError
impl RedisError
Sourcepub fn parse_redirect(msg: &str) -> Option<Self>
pub fn parse_redirect(msg: &str) -> Option<Self>
Parse a Redis error message to check for MOVED or ASK redirects
Sourcepub const fn is_redirect(&self) -> bool
pub const fn is_redirect(&self) -> bool
Check if this error is a redirect (MOVED or ASK)
Sourcepub fn redirect_target(&self) -> Option<(String, u16)>
pub fn redirect_target(&self) -> Option<(String, u16)>
Get the target address from a redirect error
Sourcepub const fn redirect_slot(&self) -> Option<u16>
pub const fn redirect_slot(&self) -> Option<u16>
Get the slot number from a redirect error
Trait Implementations§
Source§impl Debug for RedisError
impl Debug for RedisError
Source§impl Display for RedisError
impl Display for RedisError
Source§impl Error for RedisError
impl Error for RedisError
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 RedisError
impl !RefUnwindSafe for RedisError
impl Send for RedisError
impl Sync for RedisError
impl Unpin for RedisError
impl !UnwindSafe for RedisError
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