avro_schema/error.rs
1//! Contains [`Error`]
2
3/// Error from this crate
4#[derive(Debug, Clone, Copy)]
5pub enum Error {
6 /// Generic error when the file is out of spec
7 OutOfSpec,
8 /// When reading or writing with compression but the feature flag "compression" is not active.
9 RequiresCompression,
10}
11
12impl std::fmt::Display for Error {
13 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14 write!(f, "{:?}", self)
15 }
16}
17
18impl From<std::io::Error> for Error {
19 fn from(_: std::io::Error) -> Self {
20 Error::OutOfSpec
21 }
22}