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
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.
§

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

source§

fn clone(&self) -> NetdocErrorKind

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NetdocErrorKind

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for NetdocErrorKind

source§

fn fmt(&self, _derive_more_display_formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for NetdocErrorKind

source§

fn eq(&self, other: &NetdocErrorKind) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for NetdocErrorKind

source§

impl Eq for NetdocErrorKind

source§

impl StructuralPartialEq for NetdocErrorKind

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more