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
sourceimpl 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>
use code() instead
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
sourceimpl Debug for RedisError
impl Debug for RedisError
sourceimpl Display for RedisError
impl Display for RedisError
sourceimpl Error for RedisError
impl Error for RedisError
sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourcefn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
replaced by Error::source, which can support downcasting
sourceimpl From<(ErrorKind, &'static str)> for RedisError
impl From<(ErrorKind, &'static str)> for RedisError
sourcefn from((kind, desc): (ErrorKind, &'static str)) -> RedisError
fn from((kind, desc): (ErrorKind, &'static str)) -> RedisError
Converts to this type from the input type.
sourceimpl From<Error> for RedisError
impl From<Error> for RedisError
sourcefn from(err: Error) -> RedisError
fn from(err: Error) -> RedisError
Converts to this type from the input type.
sourceimpl From<FromUtf8Error> for RedisError
impl From<FromUtf8Error> for RedisError
sourcefn from(_: FromUtf8Error) -> RedisError
fn from(_: FromUtf8Error) -> RedisError
Converts to this type from the input type.
sourceimpl From<Utf8Error> for RedisError
impl From<Utf8Error> for RedisError
sourcefn from(_: Utf8Error) -> RedisError
fn from(_: Utf8Error) -> RedisError
Converts to this type from the input type.
sourceimpl PartialEq<RedisError> for RedisError
impl PartialEq<RedisError> for RedisError
Auto Trait Implementations
impl !RefUnwindSafe for RedisError
impl Send for RedisError
impl Sync for RedisError
impl Unpin for RedisError
impl !UnwindSafe for RedisError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more