pub struct Context<W> {
    pub expansion: ObjectExpansion,
    pub nondeterministic_thread_count: Option<usize>,
    pub thin: bool,
    pub thread_limit: Option<usize>,
    pub statistics: Option<OutputFormat>,
    pub pack_cache_size_in_bytes: usize,
    pub object_cache_size_in_bytes: usize,
    pub out: W,
}
Expand description

A general purpose context for many operations provided here

Fields§

§expansion: ObjectExpansion

The way input objects should be handled

§nondeterministic_thread_count: Option<usize>

If Some(threads), use this amount of threads to accelerate the counting phase at the cost of losing determinism as the order of objects during expansion changes with multiple threads unless no expansion is performed. In the latter case, this flag has no effect. If None, counting will only use one thread and thus yield the same sequence of objects in any case.

§thin: bool

If true, delta objects may refer to their base as reference, allowing it not to be included in the created back. Otherwise these have to be recompressed in order to make the pack self-contained.

§thread_limit: Option<usize>

If set, don’t use more than this amount of threads. Otherwise, usually use as many threads as there are logical cores. A value of 0 is interpreted as no-limit

§statistics: Option<OutputFormat>

If set, statistics about the operation will be written to the output stream.

§pack_cache_size_in_bytes: usize

The size of the cache storing fully decoded delta objects. This can greatly speed up pack decoding by reducing the length of delta chains. Note that caches also incur a cost and poorly used caches may reduce overall performance. This is a total, shared among all threads if thread_limit permits.

If 0, the cache is disabled entirely.

§object_cache_size_in_bytes: usize

The size of the cache to store full objects by their ID, bypassing any lookup in the object database. Note that caches also incur a cost and poorly used caches may reduce overall performance.

This is a total, shared among all threads if thread_limit permits. Only used when known to be effective, namely when expansion == ObjectExpansion::TreeDiff.

§out: W

The output stream for use of additional information

Auto Trait Implementations§

§

impl<W> RefUnwindSafe for Context<W>where W: RefUnwindSafe,

§

impl<W> Send for Context<W>where W: Send,

§

impl<W> Sync for Context<W>where W: Sync,

§

impl<W> Unpin for Context<W>where W: Unpin,

§

impl<W> UnwindSafe for Context<W>where W: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.