pub enum SerializerError {
EncodeFailed(String),
DecodeFailed(String),
FormatMismatch {
expected: &'static str,
actual: &'static str,
},
VersionIncompatible,
}Expand description
Serializer error (A2-2: fine-grained variants) | 序列化错误(A2-2:精细错误变体)
EncodeFailed: serde encode failure — log data model, do not retry 编码失败:记录数据模型问题,不要重试DecodeFailed: malformed payload — log and consider fallback/migration 解码失败:记录并考虑降级/迁移FormatMismatch: e.g. JsonSerializer sees binary magic — check config 格式不匹配:检查序列化器配置VersionIncompatible: reserved for schema evolution 版本不兼容:预留模式演进
Variants§
EncodeFailed(String)
Encoding failed | 编码失败
DecodeFailed(String)
Decoding failed | 解码失败
FormatMismatch
Format mismatch between serializer and payload | 序列化器与 payload 格式不匹配
Fields
VersionIncompatible
Version incompatible (future schema evolution) | 版本不兼容(未来模式演进)
Trait Implementations§
Source§impl Clone for SerializerError
impl Clone for SerializerError
Source§fn clone(&self) -> SerializerError
fn clone(&self) -> SerializerError
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 moreSource§impl Debug for SerializerError
impl Debug for SerializerError
Source§impl Display for SerializerError
impl Display for SerializerError
impl Eq for SerializerError
Source§impl Error for SerializerError
impl Error for SerializerError
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 PartialEq for SerializerError
impl PartialEq for SerializerError
impl StructuralPartialEq for SerializerError
Auto Trait Implementations§
impl Freeze for SerializerError
impl RefUnwindSafe for SerializerError
impl Send for SerializerError
impl Sync for SerializerError
impl Unpin for SerializerError
impl UnsafeUnpin for SerializerError
impl UnwindSafe for SerializerError
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