pub enum MessageKey {
Show 16 variants
ConnectionFailed,
ConnectionTimeout,
QueryError,
NotFound,
ConstraintViolation,
PoolExhausted,
PoolTimeout,
TxNotStarted,
TxCommitFailed,
TxRollbackFailed,
CacheMiss,
CacheWriteFailed,
SqlInjectionDetected,
MissingParameter,
TypeMismatch,
Custom,
}Expand description
消息键枚举
覆盖 sz-orm-core 的核心错误类型。 后续版本将逐步扩展。
Variants§
ConnectionFailed
连接失败
ConnectionTimeout
连接超时
QueryError
查询错误
NotFound
未找到
ConstraintViolation
约束违反
PoolExhausted
连接池耗尽
PoolTimeout
连接池超时
TxNotStarted
事务未启动
TxCommitFailed
事务提交失败
TxRollbackFailed
事务回滚失败
CacheMiss
缓存未命中
CacheWriteFailed
缓存写入失败
SqlInjectionDetected
SQL 注入检测
MissingParameter
参数绑定缺失
TypeMismatch
类型转换失败
Custom
自定义消息(向后兼容)
Implementations§
Source§impl MessageKey
impl MessageKey
Sourcepub fn default_msg(self) -> &'static str
pub fn default_msg(self) -> &'static str
获取默认中文消息
Trait Implementations§
Source§impl Clone for MessageKey
impl Clone for MessageKey
Source§fn clone(&self) -> MessageKey
fn clone(&self) -> MessageKey
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 MessageKey
Source§impl Debug for MessageKey
impl Debug for MessageKey
impl Eq for MessageKey
Source§impl Hash for MessageKey
impl Hash for MessageKey
Source§impl PartialEq for MessageKey
impl PartialEq for MessageKey
impl StructuralPartialEq for MessageKey
Auto Trait Implementations§
impl Freeze for MessageKey
impl RefUnwindSafe for MessageKey
impl Send for MessageKey
impl Sync for MessageKey
impl Unpin for MessageKey
impl UnsafeUnpin for MessageKey
impl UnwindSafe for MessageKey
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more