Enum tor_netdoc::Error [−][src]
#[non_exhaustive]
pub enum Error {
Show 32 variants
Internal(Pos),
MissingKeyword(Pos),
TruncatedLine(Pos),
BadKeyword(Pos),
BadObjectBeginTag(Pos),
BadObjectEndTag(Pos),
BadObjectMismatchedTag(Pos),
BadObjectBase64(Pos),
DuplicateToken(&'static str, Pos),
UnexpectedToken(&'static str, Pos),
MissingToken(&'static str),
MisplacedToken(&'static str, Pos),
TooManyArguments(&'static str, Pos),
TooFewArguments(&'static str, Pos),
UnexpectedObject(&'static str, Pos),
MissingObject(&'static str, Pos),
WrongObject(Pos),
MissingArgument(Pos),
BadArgument(Pos, String),
BadObjectVal(Pos, String),
BadSignature(Pos),
BadTorVersion(Pos),
BadPolicy(Pos, PolicyError),
Untimely(Pos, TimeValidityError),
Undecodable(Pos, Error),
BadDocumentVersion(u32),
BadDocumentType,
WrongStartingToken(String, Pos),
WrongEndingToken(String, Pos),
WrongSortOrder(Pos),
InvalidLifetime,
CannotBuild(&'static str),
}
Expand description
An error that occurred while parsing a directory object of some kind.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Internal(Pos)
Tuple Fields
0: Pos
An internal error in the parser: these should never happen.
MissingKeyword(Pos)
Tuple Fields
0: Pos
An entry was found with no keyword.
TruncatedLine(Pos)
Tuple Fields
0: Pos
An entry was found with no newline at the end.
BadKeyword(Pos)
Tuple Fields
0: Pos
A bad string was found in the keyword position.
BadObjectBeginTag(Pos)
Tuple Fields
0: Pos
We found an ill-formed “BEGIN FOO” tag.
BadObjectEndTag(Pos)
Tuple Fields
0: Pos
We found an ill-formed “END FOO” tag.
BadObjectMismatchedTag(Pos)
Tuple Fields
0: Pos
We found a “BEGIN FOO” tag with an “END FOO” tag that didn’t match.
BadObjectBase64(Pos)
Tuple Fields
0: Pos
We found a base64 object with an invalid base64 encoding.
DuplicateToken(&'static str, Pos)
The document is not supposed to contain more than one of some kind of entry, but we found one anyway.
UnexpectedToken(&'static str, Pos)
The document is not supposed to contain any of some particular kind of entry, but we found one anyway.
MissingToken(&'static str)
Tuple Fields
0: &'static str
The document is supposed to contain any of some particular kind of entry, but we didn’t find one one anyway.
MisplacedToken(&'static str, Pos)
The document was supposed to have one of these, but not where we found it.
TooManyArguments(&'static str, Pos)
We found more arguments on an entry than it is allowed to have.
TooFewArguments(&'static str, Pos)
We didn’t fine enough arguments for some entry.
UnexpectedObject(&'static str, Pos)
We found an object attached to an entry that isn’t supposed to have one.
MissingObject(&'static str, Pos)
An entry was supposed to have an object, but it didn’t.
WrongObject(Pos)
Tuple Fields
0: Pos
We found an object on an entry, but the type was wrong.
MissingArgument(Pos)
Tuple Fields
0: Pos
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(Pos, String)
We found an argument that couldn’t be parsed.
BadObjectVal(Pos, String)
We found an object that couldn’t be parsed after it was decoded.
BadSignature(Pos)
Tuple Fields
0: Pos
There was some signature that we couldn’t validate.
BadTorVersion(Pos)
Tuple Fields
0: Pos
There was a tor version we couldn’t parse.
BadPolicy(Pos, PolicyError)
There was an ipv4 or ipv6 policy entry that we couldn’t parse.
Untimely(Pos, TimeValidityError)
An object was expired or not yet valid.
Undecodable(Pos, Error)
An underlying byte sequence couldn’t be decoded.
BadDocumentVersion(u32)
Tuple Fields
0: u32
Versioned document with an unrecognized version.
BadDocumentType
Unexpected document type
WrongStartingToken(String, Pos)
Document or section started with wrong token
WrongEndingToken(String, Pos)
Document or section ended with wrong token
WrongSortOrder(Pos)
Tuple Fields
0: Pos
Items not sorted as expected
InvalidLifetime
A consensus lifetime was ill-formed.
CannotBuild(&'static str)
Tuple Fields
0: &'static str
We’re unable to finish building an object, for some reason.
Implementations
Return a new error based on this one, with any byte-based position mapped to some line within a string.
Return a new error based on this one, with the position (if any) replaced by ‘p’.
Trait Implementations
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for Error
impl UnwindSafe for Error
Blanket Implementations
Mutably borrows from an owned value. Read more