#[non_exhaustive]pub enum ParseError {
Kind {
expected: &'static str,
backtrace: Option<Backtrace>,
span_trace: SpanTrace,
},
Postcard {
source: Error,
backtrace: Option<Backtrace>,
span_trace: SpanTrace,
},
Encoding {
source: DecodeError,
backtrace: Option<Backtrace>,
span_trace: SpanTrace,
},
Verify {
message: &'static str,
backtrace: Option<Backtrace>,
span_trace: SpanTrace,
},
}
Available on crate feature
ticket
only.Expand description
An error deserializing an iroh ticket.
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.
Kind
Found a ticket with the wrong prefix, indicating the wrong kind.
Fields
Postcard
This looks like a ticket, but postcard deserialization failed.
Encoding
This looks like a ticket, but base32 decoding failed.
Verify
Verification of the deserialized bytes failed.
Implementations§
Source§impl ParseError
impl ParseError
Sourcepub fn wrong_prefix(expected: &'static str) -> Self
pub fn wrong_prefix(expected: &'static str) -> Self
Returns a ParseError
that indicates the given ticket has the wrong
prefix.
Indicate the expected prefix.
Sourcepub fn verification_failed(message: &'static str) -> Self
pub fn verification_failed(message: &'static str) -> Self
Return a ParseError
variant that indicates verification of the
deserialized bytes failed.
Trait Implementations§
Source§impl Debug for ParseError
impl Debug for ParseError
Source§impl Display for ParseError
impl Display for ParseError
Source§impl Error for ParseError
impl Error for ParseError
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§impl ErrorCompat for ParseError
impl ErrorCompat for ParseError
Source§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Returns an iterator for traversing the chain of errors,
starting with the current error
and continuing with recursive calls to
Error::source
. Read moreSource§impl From<DecodeError> for ParseError
impl From<DecodeError> for ParseError
Source§fn from(error: DecodeError) -> Self
fn from(error: DecodeError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ParseError
impl !RefUnwindSafe for ParseError
impl Send for ParseError
impl Sync for ParseError
impl Unpin for ParseError
impl !UnwindSafe for ParseError
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
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
Mutably borrows from an owned value. Read more
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<E> InstrumentError for Ewhere
TracedError<E>: From<E>,
impl<E> InstrumentError for Ewhere
TracedError<E>: From<E>,
Source§type Instrumented = TracedError<E>
type Instrumented = TracedError<E>
The type of the wrapped error after instrumentation
Source§fn in_current_span(self) -> <E as InstrumentError>::Instrumented
fn in_current_span(self) -> <E as InstrumentError>::Instrumented
Instrument an Error by bundling it with a SpanTrace Read more