Struct mod_redis::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 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.
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)> for RedisError
impl From<(ErrorKind, &'static str)> for RedisError
§fn from(_: (ErrorKind, &'static str)) -> RedisError
fn from(_: (ErrorKind, &'static str)) -> RedisError
§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<Elapsed> for RedisError
impl From<Elapsed> for RedisError
§fn from(_: Elapsed) -> RedisError
fn from(_: Elapsed) -> RedisError
§impl From<Error> for RedisError
impl From<Error> for RedisError
§fn from(err: Error) -> RedisError
fn from(err: Error) -> 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
§impl From<NulError> for RedisError
impl From<NulError> for RedisError
§fn from(err: NulError) -> RedisError
fn from(err: NulError) -> RedisError
§impl From<ServerError> for RedisError
impl From<ServerError> for RedisError
§fn from(value: ServerError) -> RedisError
fn from(value: ServerError) -> RedisError
§impl From<Utf8Error> for RedisError
impl From<Utf8Error> for RedisError
§fn from(_: Utf8Error) -> RedisError
fn from(_: Utf8Error) -> RedisError
§impl PartialEq for RedisError
impl PartialEq for RedisError
§fn eq(&self, other: &RedisError) -> bool
fn eq(&self, other: &RedisError) -> bool
self
and other
values to be equal, and is used
by ==
.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
§impl<E> ExternalError for E
impl<E> ExternalError for E
fn into_lua_err(self) -> Error
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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