pub enum Error {
Io(Error),
Unsupported(String),
InvalidData(String),
Eof,
NeedMore,
FormatNotFound(String),
CodecNotFound(String),
ResourceExhausted(String),
Other(String),
}Variants§
Io(Error)
Unsupported(String)
InvalidData(String)
Eof
NeedMore
FormatNotFound(String)
CodecNotFound(String)
ResourceExhausted(String)
A decoder (or arena pool) refused to allocate or proceed because
doing so would exceed a configured DecoderLimits
cap, or because a pool has no free slot. This is the canonical
“DoS protection fired” error — callers should treat it as a hard
rejection of the input or a transient backpressure signal, never
retry blindly.
Other(String)
Implementations§
Source§impl Error
impl Error
pub fn unsupported(msg: impl Into<String>) -> Self
pub fn invalid(msg: impl Into<String>) -> Self
pub fn other(msg: impl Into<String>) -> Self
Sourcepub fn resource_exhausted(msg: impl Into<String>) -> Self
pub fn resource_exhausted(msg: impl Into<String>) -> Self
Construct a Error::ResourceExhausted with the given message.
Use this from any decoder that has just hit a DecoderLimits cap
or an arena-pool exhaustion.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
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