Struct git_odb::data::output::Entry[][src]

pub struct Entry {
    pub id: ObjectId,
    pub kind: Kind,
    pub decompressed_size: usize,
    pub compressed_data: Vec<u8, Global>,
}
Expand description

An entry to be written to a file.

Some of these will be in-flight and in memory while waiting to be written. Memory requirements depend on the amount of compressed data they hold.

Fields

id: ObjectId

The hash of the object to write

kind: Kind

The kind of entry represented by data. It’s used alongside with it to complete the pack entry at rest or in transit.

decompressed_size: usize

The size in bytes needed once data gets decompressed

compressed_data: Vec<u8, Global>

The compressed data right behind the header

Implementations

An object which can be identified as invalid easily which happens if objects didn’t exist even if they were referred to.

Returns true if this object doesn’t really exist but still has to be handled responsibly

pub fn from_pack_entry(
    entry: Entry<'_>,
    count: &Count,
    potential_bases: &[Count],
    bases_index_offset: usize,
    pack_offset_to_oid: Option<impl FnMut(u32, u64) -> Option<ObjectId>>,
    target_version: Version
) -> Option<Result<Entry, Error>>

Create an Entry from a previously counted object which is located in a pack. It’s entry is provided here. The version specifies what kind of target Entry version the caller desires.

Create a new instance from the given oid and its corresponding git object data.

pub fn to_entry_header(
    &self,
    version: Version,
    index_to_base_distance: impl FnOnce(usize) -> u64
) -> Header

Transform ourselves into pack entry header of version which can be written into a pack.

index_to_pack(object_index) -> pack_offset is a function to convert the base object’s index into the input object array (if each object is numbered) to an offset into the pack. This information is known to the one calling the method.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.