Enum lzfse_rust::Error
source · #[non_exhaustive]
pub enum Error {
Io(Error),
Fse(FseErrorKind),
Vn(VnErrorKind),
BadBlock(u32),
BadBitStream,
BadDValue,
BadReaderState,
BufferOverflow,
PayloadOverflow,
PayloadUnderflow,
}
Expand description
Decoding errors.
You may want to convert Error to io::Error either directly or by using
the ?
operator, see the examples below. Reporting information is preserved across the
conversion. Error::Io errors are flattened whilst other errors are boxed into an
InvalidData variant io::Error.
Examples
use std::io;
// Direct conversion
pub fn decode(src: &[u8], dst: &mut Vec<u8>) -> io::Result<u64> {
lzfse_rust::decode_bytes(src, dst).map_err(Into::into)
}
use std::io;
// `?` operator conversion
pub fn decode(src: &[u8], dst: &mut Vec<u8>) -> io::Result<()> {
lzfse_rust::decode_bytes(src, dst)?;
Ok(())
}
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.
Io(Error)
IO errors.
Fse(FseErrorKind)
FSE specific errors.
Vn(VnErrorKind)
VN specific errors.
BadBlock(u32)
Unknown or unsupported block type (magic bytes).
BadBitStream
Bad bitstream.
BadDValue
Bad LZ distance value.
BadReaderState
Reader state is invalid, likely the user attempted to use after an error was encountered.
BufferOverflow
Buffer overflow.
PayloadOverflow
Input has more bytes than expected.
PayloadUnderflow
Input has less bytes than expected.
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)>
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<FseErrorKind> for Error
impl From<FseErrorKind> for Error
source§fn from(err: FseErrorKind) -> Error
fn from(err: FseErrorKind) -> Error
Converts to this type from the input type.
source§impl From<VnErrorKind> for Error
impl From<VnErrorKind> for Error
source§fn from(err: VnErrorKind) -> Error
fn from(err: VnErrorKind) -> Error
Converts to this type from the input type.