Skip to main content

PackObjects

Struct PackObjects 

Source
pub struct PackObjects<'a> { /* private fields */ }
Expand description

Streaming pack-objects builder over an Odb.

Implementations§

Source§

impl<'a> PackObjects<'a>

Source

pub fn new(odb: &'a Odb, opts: PackObjectsOptions) -> Self

Create a builder reading objects from odb.

Source

pub fn with_source_odb(self, source: &'a Odb) -> Self

Read object payloads from a different ODB (local fetch: remote source, local haves).

Source

pub fn wants(self, wants: &[ObjectId]) -> Self

Objects that must be included in the pack.

Source

pub fn haves(self, haves: &[ObjectId]) -> Self

Objects already held by the peer (negotiation boundary).

Source

pub fn have_shallow_grafts(self, grafts: &HashSet<ObjectId>) -> Self

Shallow grafts on the have side (local fetch).

Source

pub fn source_shallow_grafts(self, grafts: &HashSet<ObjectId>) -> Self

Shallow grafts on the source side (do not walk past on source).

Source

pub fn progress<F>(self, f: F) -> Self
where F: FnMut(PackProgress) + 'static,

Optional progress callback.

Source

pub fn write_to(self, w: &mut dyn Write) -> Result<PackStats>

Write a PACK v2 stream to w and return statistics.

§Errors

Missing wants, corrupt objects, or I/O failures while writing.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for PackObjects<'a>

§

impl<'a> !Send for PackObjects<'a>

§

impl<'a> !Sync for PackObjects<'a>

§

impl<'a> !UnwindSafe for PackObjects<'a>

§

impl<'a> Freeze for PackObjects<'a>

§

impl<'a> Unpin for PackObjects<'a>

§

impl<'a> UnsafeUnpin for PackObjects<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.