[][src]Struct git_odb::pack::File

pub struct File { /* fields omitted */ }

Implementations

impl File[src]

Reading of objects

pub fn decompress_entry(
    &self,
    entry: &Entry,
    out: &mut [u8]
) -> Result<usize, Error>
[src]

pub fn decode_entry(
    &self,
    entry: Entry,
    out: &mut Vec<u8>,
    resolve: impl Fn(&Id, &mut Vec<u8>) -> Option<ResolvedBase>,
    cache: &mut impl DecodeEntry
) -> Result<DecodeEntryResult, Error>
[src]

Decode an entry, resolving delta's as needed, while growing the output vector if there is not enough space to hold the result object. Returns (object_kind, compressed_size), referring to the entry in-pack size for use with CRC32 checks such as in crc32(pack_data[entry.data_offset..entry.data_offset + compressed_size])

impl File[src]

Instantiation and basic file information

pub fn kind(&self) -> Kind[src]

pub fn num_objects(&self) -> u32[src]

pub fn data_len(&self) -> usize[src]

pub fn path(&self) -> &Path[src]

pub fn checksum(&self) -> Id[src]

pub fn verify_checksum(&self) -> Result<Id, ChecksumError>[src]

pub fn entry_crc32(&self, pack_offset: u64, size: usize) -> u32[src]

Currently only done during pack verification - finding the right size is only possible by decompressing the pack entry beforehand, or by using the (to be sorted) offsets stored in an index file.

pub fn entry(&self, offset: u64) -> Entry[src]

pub fn at(path: impl AsRef<Path>) -> Result<File, Error>[src]

Trait Implementations

impl<'_> TryFrom<&'_ Path> for File[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for File

impl Send for File

impl Sync for File

impl Unpin for File

impl UnwindSafe for File

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.