pub enum SerializationError {
EncodeFailed {
format: &'static str,
message: String,
},
DecodeFailed {
format: &'static str,
message: String,
},
InvalidFormat {
expected: &'static str,
got: String,
},
MissingField {
field: &'static str,
},
InvalidValue {
field: &'static str,
reason: String,
},
Utf8Error(Utf8Error),
ProtobufError(String),
}Expand description
Serialization/Deserialization errors
Variants§
EncodeFailed
Encoding failed
DecodeFailed
Decoding failed
InvalidFormat
Invalid data format
MissingField
Missing required field
InvalidValue
Invalid field value
Utf8Error(Utf8Error)
UTF-8 encoding error
ProtobufError(String)
Protobuf serialization error
Implementations§
Source§impl SerializationError
impl SerializationError
Sourcepub fn encode_failed(format: &'static str, message: impl Into<String>) -> Self
pub fn encode_failed(format: &'static str, message: impl Into<String>) -> Self
Create an encode failed error
Sourcepub fn decode_failed(format: &'static str, message: impl Into<String>) -> Self
pub fn decode_failed(format: &'static str, message: impl Into<String>) -> Self
Create a decode failed error
Sourcepub fn invalid_format(expected: &'static str, got: impl Into<String>) -> Self
pub fn invalid_format(expected: &'static str, got: impl Into<String>) -> Self
Create an invalid format error
Sourcepub fn missing_field(field: &'static str) -> Self
pub fn missing_field(field: &'static str) -> Self
Create a missing field error
Trait Implementations§
Source§impl Debug for SerializationError
impl Debug for SerializationError
Source§impl Display for SerializationError
impl Display for SerializationError
Source§impl Error for SerializationError
impl Error for SerializationError
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<SerializationError> for RocketMQError
impl From<SerializationError> for RocketMQError
Source§fn from(source: SerializationError) -> Self
fn from(source: SerializationError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SerializationError
impl RefUnwindSafe for SerializationError
impl Send for SerializationError
impl Sync for SerializationError
impl Unpin for SerializationError
impl UnwindSafe for SerializationError
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