pub enum ProtocolError {
InvalidCommand {
code: i32,
},
UnsupportedVersion {
version: i32,
},
HeaderMissing {
field: &'static str,
},
BodyMissing,
ChecksumMismatch {
expected: u32,
actual: u32,
},
InvalidMessage {
reason: String,
},
DecodeError {
ext_fields_len: usize,
header_len: usize,
},
UnsupportedSerializationType {
serialize_type: u8,
},
}Expand description
Protocol validation and processing errors
Variants§
InvalidCommand
Invalid command code
UnsupportedVersion
Unsupported protocol version
HeaderMissing
Required header field is missing
BodyMissing
Required body is missing
ChecksumMismatch
Checksum mismatch
InvalidMessage
Invalid message format
DecodeError
Protocol decode error
UnsupportedSerializationType
Unsupported serialization type
Implementations§
Source§impl ProtocolError
impl ProtocolError
Sourcepub fn invalid_command(code: i32) -> Self
pub fn invalid_command(code: i32) -> Self
Create an invalid command error
Sourcepub fn header_missing(field: &'static str) -> Self
pub fn header_missing(field: &'static str) -> Self
Create a header missing error
Sourcepub fn checksum_mismatch(expected: u32, actual: u32) -> Self
pub fn checksum_mismatch(expected: u32, actual: u32) -> Self
Create a checksum mismatch error
Sourcepub fn invalid_message(reason: impl Into<String>) -> Self
pub fn invalid_message(reason: impl Into<String>) -> Self
Create an invalid message error
Trait Implementations§
Source§impl Debug for ProtocolError
impl Debug for ProtocolError
Source§impl Display for ProtocolError
impl Display for ProtocolError
Source§impl Error for ProtocolError
impl Error for ProtocolError
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<ProtocolError> for RocketMQError
impl From<ProtocolError> for RocketMQError
Source§fn from(source: ProtocolError) -> Self
fn from(source: ProtocolError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ProtocolError
impl RefUnwindSafe for ProtocolError
impl Send for ProtocolError
impl Sync for ProtocolError
impl Unpin for ProtocolError
impl UnwindSafe for ProtocolError
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