Expand description
Utilities shared by the gitoxide crates.
Utilities requiring additional dependencies are available through feature toggles.
§Examples
use std::time::Duration;
use gix_utils::{backoff::Quadratic};
let waits: Vec<_> = Quadratic::default().take(3).collect();
assert_eq!(waits, vec![
Duration::from_millis(1),
Duration::from_millis(4),
Duration::from_millis(9),
]);§Feature Flags
bstr— Byte-string conversion utilities.progress— Progress traits, types, and I/O wrappers backed byprodash.prodash— Compatibility workaround for Cargo’s workspace feature selection, not a progress API feature. cargo-auditable replays rustc’s enabled feature names into workspace-widecargo metadata. The root package’s implicitprodashfeature then matches this optional dependency even thoughdep:prodashsuppresses its implicit feature, so Cargo rejects the request forgix-utils/prodash. Cargo’s feature reporting/selection limitations: https://github.com/rust-lang/cargo/issues/12336 Reproduce without this alias, from the workspace root (confirmed with Cargo 1.99.0): cargo metadata –locked –format-version 1 –no-default-features –features prodash > /dev/null To reassess removal after an upstream fix, delete the alias and runjust check-auditable. CI checks the actual auditable build, not the alias, so a tooling fix can make it unnecessary.progress-unit-human-numbers— Human-readable numbers in progress units.progress-unit-bytes— Human-readable byte sizes and progress units.interrupt— I/O and iterator wrappers that preserve typed cancellation errors.io-pipe— A bounded in-memory byte pipe.cache-efficiency-debug— Count cache hits, misses, and insertions and print diagnostics on drop.
Modules§
- backoff
- btoi
- A module with utilities to turn byte slices with decimal numbers back into their binary representation.
- buffers
- cache
- Cache efficiency diagnostics, enabled with
cache-efficiency-debug. - decode
- Variable-length integer decoding.
- interrupt
interrupt - Utilities to cause interruptions in common traits, like Read/Write and Iterator.
- io
io-pipe - A unidirectional pipe for bytes, analogous to a unix pipe. Available with the
io-pipefeature toggle. - iter
- Iterator utilities.
- progress
progress - Various
prodashtypes along with various utilities for comfort. - rng
- Fast pseudo-random numbers whose sequence differs across concurrently running processes.
- str
Structs§
- Buffers
- A utility to do buffer-swapping with.
Traits§
- AsBStr
bstr - Provide a borrowed byte-string view of common string and byte containers.
- AsBStr
Opt bstr - Provide an optional borrowed byte-string view of common string and byte containers.
Functions§
- git_
is_ space - Return whether
byteis whitespace according to Git’s locale-independentsane_ctypetable.