pub struct ErrorResponseMessage {
pub result: Option<DeRecResult>,
}Expand description
ErrorResponseMessage is a generic error response sent when a protocol message cannot be processed successfully.
§Context
This message may be returned in response to any DeRecMessage when the receiver encounters an error during processing.
Typical scenarios include:
- malformed or invalid message payloads
- unsupported or unknown message types
- protocol violations (e.g., invalid sequence, nonce mismatch)
- authorization or validation failures
§Semantics
This message indicates that:
- the original request was not successfully processed
- no state change should be assumed by the sender
The sender SHOULD:
- inspect the
resultfield to determine the cause of the failure - decide whether to retry, abort, or escalate based on the error
§Usage Guidelines
- This message is intended as a fallback when no more specific response type is applicable
- Protocol-specific errors SHOULD use their corresponding response messages when available
§Security Considerations
- Error responses SHOULD avoid leaking sensitive internal details
- Only high-level error information should be exposed via
result
§Idempotency
Error responses are idempotent and may be returned multiple times for repeated invalid requests.
Fields§
§result: Option<DeRecResult>Result describing the error encountered while processing the request.
This field encodes the error type and any associated status information.
Trait Implementations§
Source§impl Clone for ErrorResponseMessage
impl Clone for ErrorResponseMessage
Source§fn clone(&self) -> ErrorResponseMessage
fn clone(&self) -> ErrorResponseMessage
Returns a duplicate of the value. Read more
1.0.0 · 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 ErrorResponseMessage
impl Debug for ErrorResponseMessage
Source§impl Default for ErrorResponseMessage
impl Default for ErrorResponseMessage
Source§impl Hash for ErrorResponseMessage
impl Hash for ErrorResponseMessage
Source§impl Message for ErrorResponseMessage
impl Message for ErrorResponseMessage
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.Source§impl PartialEq for ErrorResponseMessage
impl PartialEq for ErrorResponseMessage
impl Eq for ErrorResponseMessage
impl StructuralPartialEq for ErrorResponseMessage
Auto Trait Implementations§
impl Freeze for ErrorResponseMessage
impl RefUnwindSafe for ErrorResponseMessage
impl Send for ErrorResponseMessage
impl Sync for ErrorResponseMessage
impl Unpin for ErrorResponseMessage
impl UnsafeUnpin for ErrorResponseMessage
impl UnwindSafe for ErrorResponseMessage
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