Skip to main content

MidxError

Enum MidxError 

Source
#[non_exhaustive]
pub enum MidxError {
Show 21 variants SignatureMismatch { found: u32, expected: u32, }, VersionNotRecognized { version: u8, }, HashVersionMismatch { found: u8, expected: u8, }, RequiredPackNameChunkMissing, RequiredOidFanoutChunkMissing, OidFanoutWrongSize, OidFanoutOutOfOrder { index: usize, first: u32, second: u32, next: usize, }, RequiredOidLookupChunkMissing, OidLookupWrongSize, RequiredObjectOffsetsChunkMissing, ObjectOffsetsWrongSize, PackNameChunkTooShort, PackNamesOutOfOrder { previous: String, name: String, }, LargeOffsetOutOfBounds, InvalidChunkTable { detail: String, }, NoPacksToIndex, UnknownWriteVersion { version: i64, }, PreferredPackEmpty { pack: String, }, UnknownPreferredPack { name: String, }, ReferencedPackMissing { pack_index: usize, }, BitmapWriteFailed { detail: String, },
}
Expand description

A fatal multi-pack-index condition (Git die() after error: lines).

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

SignatureMismatch

Trailing or header signature does not match MIDX.

Fields

§found: u32

Value read from the file header.

§expected: u32

Expected MIDX magic (0x4d494458).

§

VersionNotRecognized

On-disk format version byte is not supported.

Fields

§version: u8

Format version byte read from the file header.

§

HashVersionMismatch

Header hash-version byte does not match the repository object format.

Fields

§found: u8

Hash version byte read from the MIDX header.

§expected: u8

Hash version required by the repository object format.

§

RequiredPackNameChunkMissing

Required pack-names chunk is missing or cannot be parsed.

§

RequiredOidFanoutChunkMissing

Required OID fanout chunk is missing.

§

OidFanoutWrongSize

OID fanout chunk size is not 256 × 4 bytes.

§

OidFanoutOutOfOrder

OID fanout table is not monotonically non-decreasing.

Fields

§index: usize

Zero-based fanout bucket index that violated ordering.

§first: u32

Fanout count at index (must be ≤ second).

§second: u32

Fanout count at the next bucket.

§next: usize

Index of the next fanout bucket (index + 1).

§

RequiredOidLookupChunkMissing

Required OID lookup chunk is missing.

§

OidLookupWrongSize

OID lookup chunk size does not match num_objects × hash_len.

§

RequiredObjectOffsetsChunkMissing

Required object-offsets chunk is missing.

§

ObjectOffsetsWrongSize

Object-offsets chunk size does not match num_objects × 8.

§

PackNameChunkTooShort

A pack name in the pack-names chunk is not NUL-terminated.

§

PackNamesOutOfOrder

v1 MIDX pack names are not strictly increasing.

Fields

§previous: String

Previous pack file name in sorted order.

§name: String

Pack file name that breaks monotonic ordering.

§

LargeOffsetOutOfBounds

Large-offset chunk does not cover a referenced large offset slot.

§

InvalidChunkTable

Chunk table of contents could not be parsed (Git die() cases in read_table_of_contents).

Fields

§detail: String

Parse failure detail for the chunk table of contents.

§

NoPacksToIndex

Write attempted with no pack indexes to cover.

§

UnknownWriteVersion

A write requested an on-disk version other than 1 or 2 (for example through midx.version).

Fields

§version: i64

Requested version, as configured.

§

PreferredPackEmpty

Preferred pack has no objects in the MIDX.

Fields

§pack: String

Pack file basename (.pack suffix).

§

UnknownPreferredPack

Preferred pack name does not appear in the pack list.

Fields

§name: String

Preferred pack basename that was not found in the MIDX pack list.

§

ReferencedPackMissing

An existing MIDX names a pack whose .pack file is missing during rewrite.

Fields

§pack_index: usize

Zero-based index into the MIDX pack list.

§

BitmapWriteFailed

Reachability bitmap generation for a MIDX failed.

Fields

§detail: String

Why bitmap generation or writing failed.

Trait Implementations§

Source§

impl Clone for MidxError

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MidxError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for MidxError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for MidxError

Source§

impl Error for MidxError

1.30.0 · Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<MidxError> for Error

Source§

fn from(source: MidxError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for MidxError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MidxError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.