#[non_exhaustive]pub enum EncodeError {
MessageTooLarge,
ExceedsBudget {
len: u32,
max_bytes: u32,
},
}Expand description
An error that occurred while encoding a protobuf message.
Returned by the try_encode* family
(Message::try_encode and friends). The
panicking entry points (Message::encode and
friends) raise the same conditions as panics instead.
The enum is #[non_exhaustive]: further variants may be added without a
breaking change to the type name.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MessageTooLarge
The message’s encoded size exceeds the 2 GiB protobuf limit
(MAX_MESSAGE_BYTES).
Encoding such a message would produce bytes that no conforming
protobuf decoder — including buffa’s own, which returns the mirror
error DecodeError::MessageTooLarge — will accept. Shrink or
split the message instead.
ExceedsBudget
The message’s encoded size exceeds the caller-supplied budget passed
to a try_encode_bounded* entry point. The message is within the
2 GiB protobuf limit and could be encoded with a larger budget.
len is the exact encoded size (in bytes); max_bytes is the budget
that was exceeded.
Trait Implementations§
Source§impl Clone for EncodeError
impl Clone 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()