#[repr(i32)]pub enum ErrorCode {
Success = 1,
Failed = 0,
NotLogin = -1,
UserNotFound = -2,
UserDisabled = -3,
Forbidden = 403,
NotFound = 404,
ValidateFailed = 422,
DbError = 500,
}Expand description
错误码枚举(对齐 PHP BaseException 的 code 字段)
Variants§
Success = 1
成功(PHP renderSuccess 默认)
Failed = 0
失败(PHP renderError 默认 / BaseException 默认)
NotLogin = -1
未登录/参数错误(PHP not_login / 缺少必要的参数 / 密钥不准确)
UserNotFound = -2
用户不存在/未绑定(PHP 没有找到用户信息 / 请先绑定,员工信息)
UserDisabled = -3
用户已禁用/已离职/待审核(PHP 员工信息待审核 / 您已离职)
Forbidden = 403
无权限(Rust 扩展,HTTP 403)
NotFound = 404
资源不存在(Rust 扩展,HTTP 404)
ValidateFailed = 422
验证失败(Rust 扩展,HTTP 422)
DbError = 500
数据库错误(Rust 扩展,HTTP 500)
Implementations§
Trait Implementations§
impl Copy for ErrorCode
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnsafeUnpin for ErrorCode
impl UnwindSafe for ErrorCode
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.