#![feature(const_slice_index, doc_auto_cfg, let_chains, seek_stream_len)]
#![cfg_attr(not(test), deny(clippy::unwrap_used))]
#[cfg(feature = "aamp")]
pub mod aamp;
#[cfg(feature = "byml")]
pub mod byml;
#[cfg(feature = "sarc")]
pub mod sarc;
pub mod types;
mod util;
#[cfg(feature = "yaml")]
mod yaml;
#[cfg(feature = "yaz0")]
pub mod yaz0;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("Bad magic value: found `{0}`, expected `{1}`.")]
BadMagic(String, &'static str),
#[error("Data too short: found {0:#x} bytes, expected >= {1:#x}.")]
InsufficientData(usize, usize),
#[error("{0}")]
InvalidData(&'static str),
#[error("{0}")]
InvalidDataD(String),
#[error("Found {0}, expected {1}")]
TypeError(smartstring::alias::String, &'static str),
#[error(transparent)]
Io(#[from] std::io::Error),
#[cfg(feature = "binrw")]
#[error(transparent)]
BinarySerde(#[from] binrw::Error),
#[error(transparent)]
InvalidUtf8(#[from] std::str::Utf8Error),
#[cfg(feature = "yaml")]
#[error(transparent)]
InvalidNumber(#[from] lexical::Error),
#[cfg(feature = "yaml")]
#[error("Parsing YAML failed: {0}")]
InvalidYaml(#[from] ryml::Error),
#[cfg(feature = "yaml")]
#[error("Parsing YAML binary data failed: {0}")]
InvalidYamlBinary(#[from] base64::DecodeError),
#[cfg(feature = "yaz0")]
#[error(transparent)]
Yaz0Error(#[from] cxx::Exception),
#[error("{0}")]
Any(String),
}
#[cfg_attr(feature = "sarc", binrw::binread, brw(repr = u16))]
#[derive(Debug, Eq, PartialEq, Copy, Clone)]
#[repr(u16)]
pub enum Endian {
Big = 0xFFFE,
Little = 0xFEFF,
}
pub type Result<T> = std::result::Result<T, Error>;
impl Clone for Error {
fn clone(&self) -> Self {
todo!()
}
}