Struct redis::RedisError
source · pub struct RedisError { /* private fields */ }
Expand description
Represents a redis error. For the most part you should be using the Error trait to interact with this rather than the actual struct.
Implementations§
source§impl RedisError
impl RedisError
Indicates a general failure in the library.
sourcepub fn is_io_error(&self) -> bool
pub fn is_io_error(&self) -> bool
Indicates that this failure is an IO failure.
sourcepub fn is_cluster_error(&self) -> bool
pub fn is_cluster_error(&self) -> bool
Indicates that this is a cluster error.
sourcepub fn is_connection_refusal(&self) -> bool
pub fn is_connection_refusal(&self) -> bool
Returns true if this error indicates that the connection was refused. You should generally not rely much on this function unless you are writing unit tests that want to detect if a local server is available.
sourcepub fn is_timeout(&self) -> bool
pub fn is_timeout(&self) -> bool
Returns true if error was caused by I/O time out. Note that this may not be accurate depending on platform.
sourcepub fn is_connection_dropped(&self) -> bool
pub fn is_connection_dropped(&self) -> bool
Returns true if error was caused by a dropped connection.
sourcepub fn redirect_node(&self) -> Option<(&str, u16)>
pub fn redirect_node(&self) -> Option<(&str, u16)>
Returns the node the error refers to.
This returns (addr, slot_id)
.
sourcepub fn extension_error_code(&self) -> Option<&str>
👎Deprecated: use code() instead
pub fn extension_error_code(&self) -> Option<&str>
Returns the extension error code.
This method should not be used because every time the redis library
adds support for a new error code it would disappear form this method.
code()
always returns the code.
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 description(&self) -> &str
fn description(&self) -> &str
source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
source§impl From<Error> for RedisError
impl From<Error> for RedisError
source§fn from(serde_err: Error) -> RedisError
fn from(serde_err: Error) -> RedisError
source§impl From<Error> for RedisError
impl From<Error> for RedisError
source§fn from(err: Error) -> RedisError
fn from(err: Error) -> RedisError
source§impl From<Error> for RedisError
impl From<Error> for RedisError
source§fn from(err: Error) -> RedisError
fn from(err: Error) -> RedisError
source§impl From<FromUtf8Error> for RedisError
impl From<FromUtf8Error> for RedisError
source§fn from(_: FromUtf8Error) -> RedisError
fn from(_: FromUtf8Error) -> RedisError
source§impl From<NulError> for RedisError
impl From<NulError> for RedisError
source§fn from(err: NulError) -> RedisError
fn from(err: NulError) -> RedisError
source§impl From<Utf8Error> for RedisError
impl From<Utf8Error> for RedisError
source§fn from(_: Utf8Error) -> RedisError
fn from(_: Utf8Error) -> RedisError
source§impl PartialEq<RedisError> for RedisError
impl PartialEq<RedisError> for RedisError
source§fn eq(&self, other: &RedisError) -> bool
fn eq(&self, other: &RedisError) -> bool
self
and other
values to be equal, and is used
by ==
.