pub struct WaeError {
pub kind: ErrorKind,
pub message: Option<String>,
pub params: HashMap<String, String>,
}Expand description
WAE 错误类型
Fields§
§kind: ErrorKind错误类型
message: Option<String>错误消息
params: HashMap<String, String>附加参数
Implementations§
Source§impl WaeError
impl WaeError
Sourcepub fn validation(kind: ValidationErrorKind) -> WaeError
pub fn validation(kind: ValidationErrorKind) -> WaeError
创建验证错误
Sourcepub fn validation_message(message: impl Into<String>) -> WaeError
pub fn validation_message(message: impl Into<String>) -> WaeError
创建验证错误(简单消息)
Sourcepub fn network(kind: NetworkErrorKind) -> WaeError
pub fn network(kind: NetworkErrorKind) -> WaeError
创建网络错误
Sourcepub fn storage(kind: StorageErrorKind) -> WaeError
pub fn storage(kind: StorageErrorKind) -> WaeError
创建存储错误
Sourcepub fn database(kind: DatabaseErrorKind) -> WaeError
pub fn database(kind: DatabaseErrorKind) -> WaeError
创建数据库错误
Sourcepub fn permission(action: impl Into<String>) -> WaeError
pub fn permission(action: impl Into<String>) -> WaeError
创建权限错误
Sourcepub fn invalid_params(message: impl Into<String>) -> WaeError
pub fn invalid_params(message: impl Into<String>) -> WaeError
创建无效参数错误
Sourcepub fn with_message(self, message: impl Into<String>) -> WaeError
pub fn with_message(self, message: impl Into<String>) -> WaeError
设置错误消息
Trait Implementations§
Source§impl<'de> Deserialize<'de> for WaeError
impl<'de> Deserialize<'de> for WaeError
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<WaeError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<WaeError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Error for WaeError
impl Error for WaeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns 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<DatabaseErrorKind> for WaeError
impl From<DatabaseErrorKind> for WaeError
Source§fn from(kind: DatabaseErrorKind) -> WaeError
fn from(kind: DatabaseErrorKind) -> WaeError
Converts to this type from the input type.
Source§impl From<NetworkErrorKind> for WaeError
impl From<NetworkErrorKind> for WaeError
Source§fn from(kind: NetworkErrorKind) -> WaeError
fn from(kind: NetworkErrorKind) -> WaeError
Converts to this type from the input type.
Source§impl From<StorageErrorKind> for WaeError
impl From<StorageErrorKind> for WaeError
Source§fn from(kind: StorageErrorKind) -> WaeError
fn from(kind: StorageErrorKind) -> WaeError
Converts to this type from the input type.
Source§impl From<ValidationErrorKind> for WaeError
impl From<ValidationErrorKind> for WaeError
Source§fn from(kind: ValidationErrorKind) -> WaeError
fn from(kind: ValidationErrorKind) -> WaeError
Converts to this type from the input type.
Source§impl From<WaeError> for CloudError
impl From<WaeError> for CloudError
Source§fn from(err: WaeError) -> CloudError
fn from(err: WaeError) -> CloudError
Converts to this type from the input type.
Source§impl Serialize for WaeError
impl Serialize for WaeError
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for WaeError
impl RefUnwindSafe for WaeError
impl Send for WaeError
impl Sync for WaeError
impl Unpin for WaeError
impl UnsafeUnpin for WaeError
impl UnwindSafe for WaeError
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