Enum tor_netdoc::NetdocErrorKind
source · #[non_exhaustive]pub enum NetdocErrorKind {
Show 34 variants
Internal,
BadApiUsage,
MissingKeyword,
TruncatedLine,
BadKeyword,
BadObjectBeginTag,
BadObjectEndTag,
BadObjectMismatchedTag,
BadObjectBase64,
DuplicateToken,
UnexpectedToken,
MissingToken,
MisplacedToken,
TooManyArguments,
TooFewArguments,
UnexpectedObject,
MissingObject,
WrongObject,
MissingArgument,
BadArgument,
BadObjectVal,
BadSignature,
BadTimeBound,
BadTorVersion,
BadPolicy,
Undecodable,
BadDocumentVersion,
BadDocumentType,
MissingEntry,
WrongStartingToken,
WrongEndingToken,
WrongSortOrder,
InvalidLifetime,
EmptyLine,
}
Expand description
A variety of parsing error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Internal
An internal error in the parser: these should never happen.
BadApiUsage
Invoked an API in an incorrect manner.
MissingKeyword
An entry was found with no keyword.
TruncatedLine
An entry was found with no newline at the end.
BadKeyword
A bad string was found in the keyword position.
BadObjectBeginTag
We found an ill-formed “BEGIN FOO” tag.
BadObjectEndTag
We found an ill-formed “END FOO” tag.
BadObjectMismatchedTag
We found a “BEGIN FOO” tag with an “END FOO” tag that didn’t match.
BadObjectBase64
We found a base64 object with an invalid base64 encoding.
DuplicateToken
The document is not supposed to contain more than one of some kind of entry, but we found one anyway.
UnexpectedToken
The document is not supposed to contain any of some particular kind of entry, but we found one anyway.
MissingToken
The document is supposed to contain any of some particular kind of entry, but we didn’t find one one anyway.
MisplacedToken
The document was supposed to have one of these, but not where we found it.
TooManyArguments
We found more arguments on an entry than it is allowed to have.
TooFewArguments
We didn’t fine enough arguments for some entry.
UnexpectedObject
We found an object attached to an entry that isn’t supposed to have one.
MissingObject
An entry was supposed to have an object, but it didn’t.
WrongObject
We found an object on an entry, but the type was wrong.
MissingArgument
We tried to find an argument that we were sure would be there, but it wasn’t!
This error should never occur in correct code; it should be caught earlier by TooFewArguments.
BadArgument
We found an argument that couldn’t be parsed.
BadObjectVal
We found an object that couldn’t be parsed after it was decoded.
BadSignature
There was some signature that we couldn’t validate.
BadTimeBound
The object is not valid at the required time.
BadTorVersion
There was a tor version we couldn’t parse.
BadPolicy
There was an ipv4 or ipv6 policy entry that we couldn’t parse.
Undecodable
An underlying byte sequence couldn’t be decoded.
BadDocumentVersion
Versioned document with an unrecognized version.
BadDocumentType
Unexpected document type
MissingEntry
We expected a kind of entry that we didn’t find
WrongStartingToken
Document or section started with wrong token
WrongEndingToken
Document or section ended with wrong token
WrongSortOrder
Items not sorted as expected
InvalidLifetime
A consensus lifetime was ill-formed.
EmptyLine
Found an empty line in the middle of a document
Trait Implementations§
source§impl Clone for NetdocErrorKind
impl Clone for NetdocErrorKind
source§fn clone(&self) -> NetdocErrorKind
fn clone(&self) -> NetdocErrorKind
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for NetdocErrorKind
impl Debug for NetdocErrorKind
source§impl Display for NetdocErrorKind
impl Display for NetdocErrorKind
source§impl PartialEq for NetdocErrorKind
impl PartialEq for NetdocErrorKind
source§fn eq(&self, other: &NetdocErrorKind) -> bool
fn eq(&self, other: &NetdocErrorKind) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for NetdocErrorKind
impl Eq for NetdocErrorKind
impl StructuralPartialEq for NetdocErrorKind
Auto Trait Implementations§
impl Freeze for NetdocErrorKind
impl RefUnwindSafe for NetdocErrorKind
impl Send for NetdocErrorKind
impl Sync for NetdocErrorKind
impl Unpin for NetdocErrorKind
impl UnwindSafe for NetdocErrorKind
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more