pub enum CarError {
BadVarint(usize),
Truncated {
at: usize,
claimed: u64,
left: usize,
},
Empty,
Header(CborError),
NotAHeader(String),
BlockCid {
at: usize,
err: CidError,
},
Mislabelled {
at: usize,
claimed: Box<Cid>,
actual: Box<Cid>,
},
Duplicate(Box<Cid>),
}Expand description
Why a byte sequence is not a CAR file this crate can read.
Variants§
BadVarint(usize)
A varint that ran off the end, or one too long to be a u64.
Truncated
A section that claims more bytes than the file has left.
Fields
Empty
The file is empty, so it has not even a header.
Header(CborError)
The header block did not decode as DAG-CBOR.
NotAHeader(String)
The header decoded and was not the map a CAR header is.
BlockCid
A block’s CID did not parse.
Mislabelled
A block that does not hash to the CID it is filed under.
Fields
Duplicate(Box<Cid>)
The same CID filed twice with different bytes, which cannot happen to a hash and means one of the two is not what it says.
Trait Implementations§
Source§impl Error for CarError
impl Error for CarError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns 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<CarError> for ProofError
impl From<CarError> for ProofError
impl Eq for CarError
impl StructuralPartialEq for CarError
Auto Trait Implementations§
impl Freeze for CarError
impl RefUnwindSafe for CarError
impl Send for CarError
impl Sync for CarError
impl Unpin for CarError
impl UnsafeUnpin for CarError
impl UnwindSafe for CarError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.