#[non_exhaustive]pub enum Error {
InvalidData(String),
UnsupportedVersion {
found: u32,
expected: u32,
},
ChecksumMismatch {
expected: String,
actual: String,
},
UnsupportedPayload {
kind: &'static str,
format: &'static str,
},
Json(Error),
Fst(Error),
Utf8(FromUtf8Error),
StrUtf8(Utf8Error),
Io(Error),
}Expand description
Library error variants.
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.
InvalidData(String)
The requested operation used invalid data.
UnsupportedVersion
The requested operation used an unsupported format version.
Fields
ChecksumMismatch
The input checksum did not match the expected value.
UnsupportedPayload
The payload kind cannot be encoded in the requested format.
Json(Error)
JSON serialization or parsing failed.
Fst(Error)
FST serialization or parsing failed.
Utf8(FromUtf8Error)
UTF-8 decoding failed.
StrUtf8(Utf8Error)
UTF-8 decoding from a borrowed slice failed.
Io(Error)
An I/O failure occurred.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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<FromUtf8Error> for Error
impl From<FromUtf8Error> for Error
Source§fn from(source: FromUtf8Error) -> Self
fn from(source: FromUtf8Error) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Forget for Error
impl Freeze for Error
impl Move for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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