pub enum Error {
Show 28 variants
Hex {
source: FromHexError,
backtrace: Backtrace,
},
Ed25519 {
source: Error,
backtrace: Backtrace,
},
Base64Decode {
source: DecodeError,
backtrace: Backtrace,
},
TryFromSlice {
source: TryFromSliceError,
backtrace: Backtrace,
},
Zbase32 {
source: DecodeError,
},
SimpleCrypto {
source: Error,
backtrace: Backtrace,
},
FromStringUtf8 {
source: FromUtf8Error,
backtrace: Backtrace,
},
SimpleDns {
source: SimpleDnsError,
backtrace: Backtrace,
},
UrlParse {
source: ParseError,
backtrace: Backtrace,
},
SerdeJson {
source: Error,
backtrace: Backtrace,
},
SimpleDatabase {
source: Error,
backtrace: Backtrace,
},
Regex {
source: Error,
backtrace: Backtrace,
},
Reqwest {
source: Error,
backtrace: Backtrace,
},
SystemTime {
source: SystemTimeError,
backtrace: Backtrace,
},
SerdeBencode {
source: Error,
backtrace: Backtrace,
},
Io {
source: Error,
backtrace: Backtrace,
},
Arc {
source: Arc<Error>,
},
FailedDowncast {
message: String,
backtrace: Backtrace,
},
Validation {
message: String,
backtrace: Backtrace,
},
Parse {
message: String,
message1: String,
backtrace: Backtrace,
},
InvalidAuth {
message: String,
backtrace: Backtrace,
},
BadResponse {
message: String,
backtrace: Backtrace,
},
BadRequest {
message: String,
backtrace: Backtrace,
},
NotFound {
message: String,
backtrace: Backtrace,
},
JsonRpc {
message: String,
backtrace: Backtrace,
},
Multi {
errors: Vec<Error>,
},
InsufficentPermission {
backtrace: Backtrace,
},
Custom {
message: String,
},
}
Variants§
Hex
Ed25519
Base64Decode
TryFromSlice
Zbase32
Fields
§
source: DecodeError
SimpleCrypto
FromStringUtf8
SimpleDns
UrlParse
SerdeJson
SimpleDatabase
Regex
Reqwest
SystemTime
SerdeBencode
Io
Arc
FailedDowncast
Validation
Parse
InvalidAuth
BadResponse
BadRequest
NotFound
JsonRpc
Multi
InsufficentPermission
Custom
Implementations§
Source§impl Error
impl Error
pub fn custom(message: &str) -> Self
pub fn bad_request(msg: &str) -> Self
pub fn bad_response(msg: &str) -> Self
pub fn invalid_auth(msg: &str) -> Self
pub fn not_found(msg: &str) -> Self
pub fn json_rpc(msg: &str) -> Self
pub fn validation(msg: &str) -> Self
pub fn multi(errors: Vec<Box<ErrorWrapper>>) -> Self
pub fn insufficent_permission() -> Self
pub fn parse(type: &str, data: &str) -> Self
pub fn arc(err: Arc<Error>) -> Self
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§impl ErrorCompat for Error
impl ErrorCompat for Error
Source§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Returns an iterator for traversing the chain of errors,
starting with the current error
and continuing with recursive calls to
Error::source
. Read moreSource§impl ErrorLike for Error
impl ErrorLike for Error
Source§impl From<DecodeError> for Error
impl From<DecodeError> for Error
Source§fn from(error: DecodeError) -> Self
fn from(error: DecodeError) -> Self
Converts to this type from the input type.
Source§impl From<DecodeError> for Error
impl From<DecodeError> for Error
Source§fn from(error: DecodeError) -> Self
fn from(error: DecodeError) -> Self
Converts to this type from the input type.
Source§impl From<FromHexError> for Error
impl From<FromHexError> for Error
Source§fn from(error: FromHexError) -> Self
fn from(error: FromHexError) -> Self
Converts to this type from the input type.
Source§impl From<FromUtf8Error> for Error
impl From<FromUtf8Error> for Error
Source§fn from(error: FromUtf8Error) -> Self
fn from(error: FromUtf8Error) -> Self
Converts to this type from the input type.
Source§impl From<ParseError> for Error
impl From<ParseError> for Error
Source§fn from(error: ParseError) -> Self
fn from(error: ParseError) -> Self
Converts to this type from the input type.
Source§impl From<SimpleDnsError> for Error
impl From<SimpleDnsError> for Error
Source§fn from(error: SimpleDnsError) -> Self
fn from(error: SimpleDnsError) -> Self
Converts to this type from the input type.
Source§impl From<SystemTimeError> for Error
impl From<SystemTimeError> for Error
Source§fn from(error: SystemTimeError) -> Self
fn from(error: SystemTimeError) -> Self
Converts to this type from the input type.
Source§impl From<TryFromSliceError> for Error
impl From<TryFromSliceError> for Error
Source§fn from(error: TryFromSliceError) -> Self
fn from(error: TryFromSliceError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
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
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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> ⓘ
Converts
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> ⓘ
Converts
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