Struct sentry::db::RedisError
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
impl RedisError
impl RedisError
Indicates a general failure in the library.
pub fn kind(&self) -> ErrorKind
pub fn kind(&self) -> ErrorKind
Returns the kind of the error.
pub fn is_io_error(&self) -> bool
pub fn is_io_error(&self) -> bool
Indicates that this failure is an IO failure.
pub fn is_cluster_error(&self) -> bool
pub fn is_cluster_error(&self) -> bool
Indicates that this is a cluster error.
pub 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.
pub 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.
pub fn is_connection_dropped(&self) -> bool
pub fn is_connection_dropped(&self) -> bool
Returns true if error was caused by a dropped connection.
pub 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)
.
pub 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
impl Debug for RedisError
impl Debug for RedisError
impl Display for RedisError
impl Display for RedisError
impl Error for RedisError
impl Error for RedisError
fn description(&self) -> &str
fn description(&self) -> &str
fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
impl From<(ErrorKind, &'static str, String)> for RedisError
impl From<(ErrorKind, &'static str, String)> for RedisError
fn from(_: (ErrorKind, &'static str, String)) -> RedisError
fn from(_: (ErrorKind, &'static str, String)) -> RedisError
impl From<(ErrorKind, &'static str)> for RedisError
impl From<(ErrorKind, &'static str)> for RedisError
fn from(_: (ErrorKind, &'static str)) -> RedisError
fn from(_: (ErrorKind, &'static str)) -> RedisError
impl From<Error> for RedisError
impl From<Error> for RedisError
fn from(err: Error) -> RedisError
fn from(err: Error) -> RedisError
impl From<FromUtf8Error> for RedisError
impl From<FromUtf8Error> for RedisError
fn from(_: FromUtf8Error) -> RedisError
fn from(_: FromUtf8Error) -> RedisError
sourceimpl From<RedisError> for Error
Available on crate feature test-util
only.
impl From<RedisError> for Error
test-util
only.