Struct gitoxide_core::pack::create::Context
source · 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> Freeze for Context<W>where
W: Freeze,
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> 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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more