Enum git_odb::data::entry::Header [−][src]
pub enum Header {
Commit,
Tree,
Blob,
Tag,
RefDelta {
base_id: ObjectId,
},
OfsDelta {
base_distance: u64,
},
}
Expand description
The header portion of a pack data entry, identifying the kind of stored object.
Variants
The object is a commit
The object is a tree
The object is a blob
The object is a tag
Describes a delta-object which needs to be applied to a base. The base object is identified by the base_id
field
which is found within the parent repository.
Most commonly used for thin-packs when receiving pack files from the server to refer to objects that are not
part of the pack but expected to be present in the receivers repository.
Note
This could also be an object within this pack if the LSB encoded offset would be larger than 20 bytes, which is unlikely to happen.
The naming is exactly the same as the canonical implementation uses, namely REF_DELTA.
Fields of RefDelta
base_id: ObjectId
Describes a delta-object present in this pack which acts as base for this object.
The base object is measured as a distance from this objects
pack offset, so that base_pack_offset = this_objects_pack_offset - base_distance
Note
The naming is exactly the same as the canonical implementation uses, namely OFS_DELTA.
Fields of OfsDelta
base_distance: u64
Implementations
Subtract distance
from pack_offset
safely without the chance for overflow or no-ops if distance
is 0.
Convert the header’s object kind into git_object::Kind
if possible
Convert this header’s object kind into the packs internal representation
Encode this header along the given decompressed_size_in_bytes
into the out
write stream for use within a data pack.
Returns the amount of bytes written to out
.
decompressed_size_in_bytes
is the full size in bytes of the object that this header represents
Trait Implementations
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
Auto Trait Implementations
impl RefUnwindSafe for Header
impl UnwindSafe for Header
Blanket Implementations
Mutably borrows from an owned value. Read more