#[non_exhaustive]pub enum EncodeError {
FrameTooLong(usize),
PayloadTooLong(usize),
PathTooLong(usize),
TooManyEntries(usize),
PayloadOnFailedStatus {
status: PlaintextStatus,
len: usize,
},
BufferTooSmall {
needed: usize,
available: usize,
},
LengthOverflow,
}Expand description
Why an envelope could not be encoded.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
FrameTooLong(usize)
The frame is longer than the u32 length prefix can describe.
PayloadTooLong(usize)
A plaintext payload is longer than the u32 length prefix can describe.
PathTooLong(usize)
A node path has more components than the u8 length prefix can
describe. Real stanzas nest to depth 9 at the extreme, so hitting this
means the path is wrong, not that the limit is tight.
TooManyEntries(usize)
More plaintext entries than the u16 count can describe.
PayloadOnFailedStatus
A plaintext entry carries a payload under a status that defines none.
Refused at the producer rather than tolerated, so an envelope whose status and payload contradict each other never reaches a consumer that has to guess which of the two to believe.
Fields
status: PlaintextStatusThe status the entry declared.
BufferTooSmall
The destination slice is smaller than encoded_len reported.
LengthOverflow
The envelope’s total size does not fit in usize on this target.
Trait Implementations§
Source§impl Clone for EncodeError
impl Clone for EncodeError
impl Copy for EncodeError
Source§impl Debug for EncodeError
impl Debug for EncodeError
Source§impl Display for EncodeError
impl Display for EncodeError
impl Eq for EncodeError
Source§impl Error for EncodeError
impl Error for EncodeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()