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
Indicates a general failure in the library.
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 is_unrecoverable_error(&self) -> bool
pub fn is_unrecoverable_error(&self) -> bool
Returns true if the error is likely to not be recoverable, and the connection must be replaced.
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.
Sourcepub fn retry_method(&self) -> RetryMethod
pub fn retry_method(&self) -> RetryMethod
Specifies what method (if any) should be used to retry this request.
If you are using the cluster api retrying of requests is already handled by the library.
This isn’t precise, and internally the library uses multiple other considerations rather than just the error kind on when to retry.
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(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 for RedisError
impl PartialEq for RedisError
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more