pub enum ApiErrorKind {
BadRequest,
Authentication,
PermissionDenied,
NotFound,
Conflict,
UnprocessableEntity,
RateLimit,
InternalServer,
Unknown,
}Expand description
表示 API 错误的大类。
Variants§
BadRequest
表示 400 类错误。
Authentication
表示鉴权失败。
PermissionDenied
表示权限不足。
NotFound
表示资源不存在。
Conflict
表示资源冲突。
UnprocessableEntity
表示请求参数语义错误。
RateLimit
表示触发限流。
InternalServer
表示服务端内部错误。
Unknown
表示未归类的 API 错误。
Implementations§
Source§impl ApiErrorKind
impl ApiErrorKind
Sourcepub fn from_status(status: u16) -> Self
pub fn from_status(status: u16) -> Self
根据 HTTP 状态码推导错误大类。
Trait Implementations§
Source§impl Clone for ApiErrorKind
impl Clone for ApiErrorKind
Source§fn clone(&self) -> ApiErrorKind
fn clone(&self) -> ApiErrorKind
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ApiErrorKind
impl Debug for ApiErrorKind
Source§impl<'de> Deserialize<'de> for ApiErrorKind
impl<'de> Deserialize<'de> for ApiErrorKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ApiErrorKind
impl PartialEq for ApiErrorKind
Source§impl Serialize for ApiErrorKind
impl Serialize for ApiErrorKind
impl Copy for ApiErrorKind
impl Eq for ApiErrorKind
impl StructuralPartialEq for ApiErrorKind
Auto Trait Implementations§
impl Freeze for ApiErrorKind
impl RefUnwindSafe for ApiErrorKind
impl Send for ApiErrorKind
impl Sync for ApiErrorKind
impl Unpin for ApiErrorKind
impl UnsafeUnpin for ApiErrorKind
impl UnwindSafe for ApiErrorKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.