pub enum VdfError {
UnexpectedToken(UnexpectedTokenError),
NoValidToken(NoValidTokenError),
WrongEventType(Box<WrongEventTypeError>),
ParseEntry(ParseEntryError),
ParseItem(ParseItemError),
ParseString(ParseStringError),
UnknownVariant(UnknownVariantError),
SerdeParse(SerdeParseError),
Other(UnknownError),
}
Expand description
Any error that occurred while trying to parse the vdf file
Variants§
UnexpectedToken(UnexpectedTokenError)
A token that wasn’t expected was found while parsing
NoValidToken(NoValidTokenError)
No valid token found
WrongEventType(Box<WrongEventTypeError>)
Wrong event to for conversion
ParseEntry(ParseEntryError)
Failed to parse entry into type
ParseItem(ParseItemError)
Failed to parse item into type
ParseString(ParseStringError)
Failed to parse string into type
UnknownVariant(UnknownVariantError)
Failed to find an enum variant that matches the found tag
SerdeParse(SerdeParseError)
Failed to parse serde string
Other(UnknownError)
Implementations§
Trait Implementations§
Source§impl Diagnostic for VdfError
impl Diagnostic for VdfError
Source§fn code(&self) -> Option<Box<dyn Display + '_>>
fn code(&self) -> Option<Box<dyn Display + '_>>
Unique diagnostic code that can be used to look up more information
about this
Diagnostic
. Ideally also globally unique, and documented
in the toplevel crate’s documentation for easy searching. Rust path
format (foo::bar::baz
) is recommended, but more classic codes like
E0123
or enums will work just fine.Source§fn help(&self) -> Option<Box<dyn Display + '_>>
fn help(&self) -> Option<Box<dyn Display + '_>>
Additional help text related to this
Diagnostic
. Do you have any
advice for the poor soul who’s just run into this issue?Source§fn severity(&self) -> Option<Severity>
fn severity(&self) -> Option<Severity>
Diagnostic severity. This may be used by
ReportHandler
s to change the display format
of this diagnostic. Read moreSource§fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
Labels to apply to this
Diagnostic
’s Diagnostic::source_code
Source§fn source_code(&self) -> Option<&dyn SourceCode>
fn source_code(&self) -> Option<&dyn SourceCode>
Source code to apply this
Diagnostic
’s Diagnostic::labels
to.Additional related
Diagnostic
s.Source§fn url(&self) -> Option<Box<dyn Display + '_>>
fn url(&self) -> Option<Box<dyn Display + '_>>
URL to visit for a more detailed explanation/help about this
Diagnostic
.Source§fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
The cause of the error.
Source§impl Error for VdfError
impl Error for VdfError
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 Error for VdfError
impl Error for VdfError
Source§fn custom<T>(msg: T) -> Selfwhere
T: Display,
fn custom<T>(msg: T) -> Selfwhere
T: Display,
Raised when there is general error when deserializing a type. Read more
Source§fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
Raised when a
Deserialize
enum type received a variant with an
unrecognized name.Source§fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Raised when a
Deserialize
receives a type different from what it was
expecting. Read moreSource§fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Raised when a
Deserialize
receives a value of the right type but that
is wrong for some other reason. Read moreSource§fn invalid_length(len: usize, exp: &dyn Expected) -> Self
fn invalid_length(len: usize, exp: &dyn Expected) -> Self
Raised when deserializing a sequence or map and the input data contains
too many or too few elements. Read more
Source§fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
Raised when a
Deserialize
struct type received a field with an
unrecognized name.Source§fn missing_field(field: &'static str) -> Self
fn missing_field(field: &'static str) -> Self
Raised when a
Deserialize
struct type expected to receive a required
field with a particular name but that field was not present in the
input.Source§fn duplicate_field(field: &'static str) -> Self
fn duplicate_field(field: &'static str) -> Self
Raised when a
Deserialize
struct type received more than one of the
same field.Source§impl From<NoValidTokenError> for VdfError
impl From<NoValidTokenError> for VdfError
Source§fn from(source: NoValidTokenError) -> Self
fn from(source: NoValidTokenError) -> Self
Converts to this type from the input type.
Source§impl From<ParseEntryError> for VdfError
impl From<ParseEntryError> for VdfError
Source§fn from(source: ParseEntryError) -> Self
fn from(source: ParseEntryError) -> Self
Converts to this type from the input type.
Source§impl From<ParseItemError> for VdfError
impl From<ParseItemError> for VdfError
Source§fn from(source: ParseItemError) -> Self
fn from(source: ParseItemError) -> Self
Converts to this type from the input type.
Source§impl From<ParseStringError> for VdfError
impl From<ParseStringError> for VdfError
Source§fn from(source: ParseStringError) -> Self
fn from(source: ParseStringError) -> Self
Converts to this type from the input type.
Source§impl From<SerdeParseError> for VdfError
impl From<SerdeParseError> for VdfError
Source§fn from(source: SerdeParseError) -> Self
fn from(source: SerdeParseError) -> Self
Converts to this type from the input type.
Source§impl From<UnexpectedTokenError> for VdfError
impl From<UnexpectedTokenError> for VdfError
Source§fn from(source: UnexpectedTokenError) -> Self
fn from(source: UnexpectedTokenError) -> Self
Converts to this type from the input type.
Source§impl From<UnknownError> for VdfError
impl From<UnknownError> for VdfError
Source§fn from(source: UnknownError) -> Self
fn from(source: UnknownError) -> Self
Converts to this type from the input type.
Source§impl From<UnknownVariantError> for VdfError
impl From<UnknownVariantError> for VdfError
Source§fn from(source: UnknownVariantError) -> Self
fn from(source: UnknownVariantError) -> Self
Converts to this type from the input type.
Source§impl From<WrongEventTypeError> for VdfError
impl From<WrongEventTypeError> for VdfError
Source§fn from(value: WrongEventTypeError) -> Self
fn from(value: WrongEventTypeError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for VdfError
impl RefUnwindSafe for VdfError
impl Send for VdfError
impl Sync for VdfError
impl Unpin for VdfError
impl UnwindSafe for VdfError
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