gix_pack/data/file/decode/
mod.rs

1use std::collections::TryReserveError;
2
3///
4pub mod entry;
5///
6pub mod header;
7
8/// Returned by [`File::decode_header()`][crate::data::File::decode_header()],
9/// [`File::decode_entry()`][crate::data::File::decode_entry()] and .
10/// [`File::decompress_entry()`][crate::data::File::decompress_entry()]
11#[derive(thiserror::Error, Debug)]
12#[allow(missing_docs)]
13pub enum Error {
14    #[error("Failed to decompress pack entry")]
15    ZlibInflate(#[from] gix_features::zlib::inflate::Error),
16    #[error("A delta chain could not be followed as the ref base with id {0} could not be found")]
17    DeltaBaseUnresolved(gix_hash::ObjectId),
18    #[error(transparent)]
19    EntryType(#[from] crate::data::entry::decode::Error),
20    #[error("Entry too large to fit in memory")]
21    OutOfMemory,
22}
23
24impl From<TryReserveError> for Error {
25    #[cold]
26    fn from(_: TryReserveError) -> Self {
27        Self::OutOfMemory
28    }
29}