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) -> Self
pub fn validation(kind: ValidationErrorKind) -> Self
创建验证错误
Sourcepub fn validation_message(message: impl Into<String>) -> Self
pub fn validation_message(message: impl Into<String>) -> Self
创建验证错误(简单消息)
Sourcepub fn network(kind: NetworkErrorKind) -> Self
pub fn network(kind: NetworkErrorKind) -> Self
创建网络错误
Sourcepub fn storage(kind: StorageErrorKind) -> Self
pub fn storage(kind: StorageErrorKind) -> Self
创建存储错误
Sourcepub fn database(kind: DatabaseErrorKind) -> Self
pub fn database(kind: DatabaseErrorKind) -> Self
创建数据库错误
Sourcepub fn permission(action: impl Into<String>) -> Self
pub fn permission(action: impl Into<String>) -> Self
创建权限错误
Sourcepub fn invalid_params(message: impl Into<String>) -> Self
pub fn invalid_params(message: impl Into<String>) -> Self
创建无效参数错误
Sourcepub fn with_message(self, message: impl Into<String>) -> Self
pub fn with_message(self, message: impl Into<String>) -> Self
设置错误消息
Trait Implementations§
Source§impl<'de> Deserialize<'de> for WaeError
impl<'de> Deserialize<'de> for WaeError
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 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) -> Self
fn from(kind: DatabaseErrorKind) -> Self
Converts to this type from the input type.
Source§impl From<NetworkErrorKind> for WaeError
impl From<NetworkErrorKind> for WaeError
Source§fn from(kind: NetworkErrorKind) -> Self
fn from(kind: NetworkErrorKind) -> Self
Converts to this type from the input type.
Source§impl From<StorageErrorKind> for WaeError
impl From<StorageErrorKind> for WaeError
Source§fn from(kind: StorageErrorKind) -> Self
fn from(kind: StorageErrorKind) -> Self
Converts to this type from the input type.
Source§impl From<ValidationErrorKind> for WaeError
impl From<ValidationErrorKind> for WaeError
Source§fn from(kind: ValidationErrorKind) -> Self
fn from(kind: ValidationErrorKind) -> Self
Converts to this type from the input type.
Source§impl From<WaeError> for CloudError
impl From<WaeError> for CloudError
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