#[non_exhaustive]
pub enum Error {
Truncated,
ExtraneousBytes,
BadLengthValue,
BadMessage(&'static str),
Bug(Bug),
}
Expand description
Error type for decoding Tor objects from bytes.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Truncated
Tried to read something, but we didn’t find enough bytes.
This can mean that the object is truncated, or that we need to read more and try again, depending on the context in which it was received.
ExtraneousBytes
Called Reader::should_be_exhausted(), but found bytes anyway.
BadLengthValue
Invalid length value
BadMessage(&'static str)
An attempt to parse an object failed for some reason related to its contents.
Bug(Bug)
A parsing error that should never happen.
We use this one in lieu of calling assert() and expect() and unwrap() from within parsing code.
Trait Implementations
sourceimpl Error for Error
impl Error for Error
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more