Enum silent::SilentError
source · pub enum SilentError {
Show 15 variants
IOError(Error),
TungsteniteError(Error),
SerdeJsonError(Error),
SerdeDeError(Error),
HyperError(Error),
FileEmpty(Error),
BodyEmpty,
JsonEmpty,
ContentTypeError,
ParamsEmpty,
ParamsNotFound,
ConfigNotFound,
WsError(String),
AnyhowError(Error),
BusinessError {
code: StatusCode,
msg: String,
},
}Expand description
SilentError is the error type for the silent library.
Variants§
IOError(Error)
IO 错误
TungsteniteError(Error)
IO 错误
SerdeJsonError(Error)
反序列化 错误
SerdeDeError(Error)
反序列化 错误
HyperError(Error)
Hyper 错误
FileEmpty(Error)
上传文件读取 错误
BodyEmpty
Body为空 错误
JsonEmpty
Json为空 错误
ContentTypeError
Json为空 错误
ParamsEmpty
Params为空 错误
ParamsNotFound
Params为空 错误
ConfigNotFound
配置不存在 错误
WsError(String)
websocket错误
AnyhowError(Error)
anyhow错误
BusinessError
业务错误
Implementations§
source§impl SilentError
impl SilentError
pub fn business_error_obj<S>(code: StatusCode, msg: S) -> Selfwhere
S: Serialize,
pub fn business_error(code: StatusCode, msg: String) -> Self
pub fn status_code(&self) -> StatusCode
pub fn message(&self) -> String
pub fn trace(&self) -> Backtrace
Trait Implementations§
source§impl Debug for SilentError
impl Debug for SilentError
source§impl Display for SilentError
impl Display for SilentError
source§impl Error for SilentError
impl Error for SilentError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<Error> for SilentError
impl From<Error> for SilentError
source§impl From<Error> for SilentError
impl From<Error> for SilentError
source§impl From<Error> for SilentError
impl From<Error> for SilentError
source§impl From<Error> for SilentError
impl From<Error> for SilentError
source§impl From<Error> for SilentError
impl From<Error> for SilentError
source§impl From<Error> for SilentError
impl From<Error> for SilentError
source§impl From<Error> for SilentError
impl From<Error> for SilentError
source§impl From<SilentError> for Response
impl From<SilentError> for Response
source§fn from(value: SilentError) -> Self
fn from(value: SilentError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for SilentError
impl !RefUnwindSafe for SilentError
impl Send for SilentError
impl Sync for SilentError
impl Unpin for SilentError
impl !UnwindSafe for SilentError
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
Mutably borrows from an owned value. Read more