1pub mod format;
8pub mod reader;
9#[cfg(feature = "signing")]
10pub mod signing;
11pub mod table_of_contents;
12
13#[derive(Debug, thiserror::Error)]
14pub enum Error {
15 #[error("(de)serialization error: {0}")]
16 Scroll(#[from] scroll::Error),
17
18 #[error("unable to parse checksum string: {0}")]
19 BadChecksum(&'static str),
20
21 #[error("I/O error: {0}")]
22 Io(#[from] std::io::Error),
23
24 #[error("decompression error: {0}")]
25 Decompress(#[from] flate2::DecompressError),
26
27 #[error("XML error: {0}")]
28 SerdeXml(#[from] serde_xml_rs::Error),
29
30 #[error("XML write error: {0}")]
31 XmlWrite(#[from] xml::writer::Error),
32
33 #[error("Invalid file ID")]
34 InvalidFileId,
35
36 #[error("table of contents is corrupted: {0}")]
37 TableOfContentsCorrupted(&'static str),
38
39 #[error("File has no data")]
40 FileNoData,
41
42 #[error("Unimplemented file encoding: {0}")]
43 UnimplementedFileEncoding(String),
44
45 #[error("Operation not supported: {0}")]
46 Unsupported(&'static str),
47
48 #[error("x509 certificate error: {0}")]
49 X509Certificate(#[from] x509_certificate::X509CertificateError),
50
51 #[cfg(feature = "signing")]
52 #[error("signing error: {0}")]
53 SignatureCreation(#[from] signature::Error),
54
55 #[cfg(feature = "signing")]
56 #[error("CMS error: {0}")]
57 Cms(#[from] cryptographic_message_syntax::CmsError),
58
59 #[cfg(feature = "signing")]
60 #[error("HTTP error: {0}")]
61 Reqwest(#[from] reqwest::Error),
62}
63
64pub type XarResult<T> = std::result::Result<T, Error>;