pub struct PackIndex {
pub version: u32,
pub fanout: [u32; 256],
pub entries: Vec<PackIndexEntry>,
pub pack_checksum: ObjectId,
pub index_checksum: ObjectId,
}Fields§
§version: u32§fanout: [u32; 256]§entries: Vec<PackIndexEntry>§pack_checksum: ObjectId§index_checksum: ObjectIdImplementations§
Source§impl PackIndex
impl PackIndex
pub fn write_v2_for_pack_sha1(pack_bytes: &[u8]) -> Result<PackIndexBuild>
pub fn write_v2_for_pack( pack_bytes: &[u8], format: ObjectFormat, ) -> Result<PackIndexBuild>
pub fn parse_v2_sha1(bytes: &[u8]) -> Result<Self>
pub fn parse(bytes: &[u8], format: ObjectFormat) -> Result<Self>
pub fn find(&self, oid: &ObjectId) -> Option<&PackIndexEntry>
pub fn write_v2_sha1( entries: &[PackIndexEntry], pack_checksum: &ObjectId, ) -> Result<Vec<u8>>
pub fn write_v2( format: ObjectFormat, entries: &[PackIndexEntry], pack_checksum: &ObjectId, ) -> Result<Vec<u8>>
Sourcepub fn write_v1(
format: ObjectFormat,
entries: &[PackIndexEntry],
pack_checksum: &ObjectId,
) -> Result<Vec<u8>>
pub fn write_v1( format: ObjectFormat, entries: &[PackIndexEntry], pack_checksum: &ObjectId, ) -> Result<Vec<u8>>
Serialise a version-1 pack .idx: a 256-entry fanout, then for each
object an inline 4-byte big-endian pack offset immediately followed by
its object id (sorted by oid), then the pack checksum and a trailing
index checksum. v1 has no CRC table and cannot represent offsets that
do not fit in 32 bits.
Trait Implementations§
impl Eq for PackIndex
impl StructuralPartialEq for PackIndex
Auto Trait Implementations§
impl Freeze for PackIndex
impl RefUnwindSafe for PackIndex
impl Send for PackIndex
impl Sync for PackIndex
impl Unpin for PackIndex
impl UnsafeUnpin for PackIndex
impl UnwindSafe for PackIndex
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