#[non_exhaustive]pub enum ParseError {
Kind {
expected: &'static str,
meta: Meta,
},
Postcard {
source: Error,
meta: Meta,
},
Encoding {
source: DecodeError,
meta: Meta,
},
Verify {
message: &'static str,
meta: Meta,
},
}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.
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 source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<DecodeError> for ParseError
impl From<DecodeError> for ParseError
Source§fn from(source: DecodeError) -> Self
fn from(source: DecodeError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for ParseError
impl From<Error> for ParseError
Source§impl From<ParseError> for AnyError
impl From<ParseError> for AnyError
Source§fn from(value: ParseError) -> AnyError
fn from(value: ParseError) -> AnyError
Converts to this type from the input type.
Source§impl StackError for ParseError
impl StackError for ParseError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Returns this error as a std error reference.
Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Returns this error as a std error.
Source§fn as_dyn(&self) -> &dyn StackError
fn as_dyn(&self) -> &dyn StackError
Returns this error as a
dyn StackError.Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Returns the next source in the chain, if any.
Source§fn is_transparent(&self) -> bool
fn is_transparent(&self) -> bool
Returns whether this error is transparent and should be skipped in reports.
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> 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