Struct git_odb::pack::Bundle[][src]

pub struct Bundle {
    pub pack: File,
    pub index: File,
}

A bundle of pack data and the corresponding pack index

Fields

pack: File

The pack file corresponding to index

index: File

The index file corresponding to pack

Implementations

impl Bundle[src]

pub fn find<'a>(
    &self,
    id: impl AsRef<oid>,
    out: &'a mut Vec<u8>,
    cache: &mut impl DecodeEntry
) -> Result<Option<Object<'a>>, Error>
[src]

Find an object with the given ObjectId and place its data into out.

cache is used to accelerate the lookup.

Note that ref deltas are automatically resolved within this pack only, which makes this implementation unusable for thin packs, which by now are expected to be resolved already.

impl Bundle[src]

pub fn write_stream_to_directory(
    pack: impl BufRead,
    directory: Option<impl AsRef<Path>>,
    progress: impl Progress,
    options: Options
) -> Result<Outcome, Error>
[src]

Given a pack data stream into the directory if Some or discard it entirely if None.

progress provides detailed progress information which can be discarded with [git_features::progress::Discard]. options further configure how the task is performed.

pub fn write_to_directory_eagerly(
    pack: impl Read + Send + 'static,
    pack_size: Option<u64>,
    directory: Option<impl AsRef<Path>>,
    progress: impl Progress,
    options: Options
) -> Result<Outcome, Error>
[src]

Equivalent to write_stream_to_directory() but offloads reading of the pack into its own thread, hence the Send + 'static' bounds.

impl Bundle[src]

pub fn verify_integrity<C, P>(
    &self,
    verify_mode: Mode,
    traversal: Algorithm,
    make_pack_lookup_cache: impl Fn() -> C + Send + Sync,
    thread_limit: Option<usize>,
    progress: Option<P>
) -> Result<(ObjectId, Option<Outcome>, Option<P>), Error<Error>> where
    P: Progress,
    C: DecodeEntry
[src]

Similar to pack::index::File::verify_integrity() but more convenient to call as the presence of the pack file is a given.

impl Bundle[src]

Initialization

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

Create a Bundle from path, which is either a pack file (*.pack) or an index file (*.idx).

The corresponding complementary file is expected to be present. Also available via Bundle::try_from().

Trait Implementations

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

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Bundle

impl Send for Bundle

impl Sync for Bundle

impl Unpin for Bundle

impl UnwindSafe for Bundle

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> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

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

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

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> TryConv for T

impl<T> TryConv for T

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,