Enum tor_bytes::Error [−][src]
#[non_exhaustive]
pub enum Error {
Truncated,
ExtraneousBytes,
BadMessage(&'static str),
Internal,
}
Expand description
Error type for decoding Tor objects from bytes.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
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.
BadMessage(&'static str)
Tuple Fields
0: &'static str
An attempt to parse an object failed for some reason related to its contents.
Internal
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
Auto Trait Implementations
impl RefUnwindSafe for Error
impl UnwindSafe for Error
Blanket Implementations
Mutably borrows from an owned value. Read more