pub enum Error {
Io {
message: String,
},
Invalid {
message: String,
},
UnexpectedToken {
expected: Vec<&'static str>,
got: &'static str,
},
UnexpectedSymbol {
expected: Vec<&'static str>,
got: String,
},
ArgCountMismatch {
expected: u64,
got: u64,
},
Deserialize {
path: String,
expected: &'static str,
got: String,
},
}Expand description
Variants§
Io
An underlying std::io::Error from a writer, flattened to its message.
Invalid
Malformed input with no further structured data worth surfacing: bad/short
header, wrong version/separator, truncated or over-long varint, unexpected
EOF, byte-count overflow, unknown token/element byte, invalid UTF-8, an
empty enum, a NaN real, an unparseable symbol name, or an unsupported
packed-array element type. The message says which.
UnexpectedToken
Got a token that isn’t one of the accepted set for this position. An empty
expected means “any value token except the one we got” (e.g. a Rule
where a value was required).
Fields
UnexpectedSymbol
Got a Symbol whose name isn’t one of the accepted set (e.g. True/False,
or an Option/Result variant name).
Fields
ArgCountMismatch
A Function’s argument count didn’t match what the caller expected.
Deserialize
Type mismatch during typed deserialization via FromWXF.
Threaded with a dotted field path by the derive (e.g. "Frame.payload").
Implementations§
Source§impl Error
impl Error
Sourcepub fn invalid(message: String) -> Self
pub fn invalid(message: String) -> Self
Build an Error::Invalid from a message — for malformed input that has
no further structured data worth a dedicated variant.
Sourcepub fn unexpected_token(expected: &[&'static str], got: ExpressionEnum) -> Self
pub fn unexpected_token(expected: &[&'static str], got: ExpressionEnum) -> Self
Build an Error::UnexpectedToken from the accepted token names and the
token actually read. An empty expected slice means “any token but this”.