pub struct AppErrCode {
pub domain: &'static str,
pub code: i32,
pub message: &'static str,
}Expand description
归一化错误码值类型。
纯值类型,无堆分配,无虚表,可 Copy/Clone。
错误身份由 domain + code 唯一决定,message 仅用于展示。
code 使用 i32 以支持负数通用错误码(如 -1 表示通用错误)。
Fields§
§domain: &'static str§code: i32§message: &'static strImplementations§
Source§impl AppErrCode
impl AppErrCode
Trait Implementations§
Source§impl Clone for AppErrCode
impl Clone for AppErrCode
Source§fn clone(&self) -> AppErrCode
fn clone(&self) -> AppErrCode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AppErrCode
Source§impl Debug for AppErrCode
impl Debug for AppErrCode
Source§impl Display for AppErrCode
impl Display for AppErrCode
impl Eq for AppErrCode
Auto Trait Implementations§
impl Freeze for AppErrCode
impl RefUnwindSafe for AppErrCode
impl Send for AppErrCode
impl Sync for AppErrCode
impl Unpin for AppErrCode
impl UnsafeUnpin for AppErrCode
impl UnwindSafe for AppErrCode
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