Skip to main content

Crate gix_utils

Crate gix_utils 

Source
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 by prodash.
  • 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.
interruptinterrupt
Utilities to cause interruptions in common traits, like Read/Write and Iterator.
ioio-pipe
A unidirectional pipe for bytes, analogous to a unix pipe. Available with the io-pipe feature toggle.
iter
Iterator utilities.
progressprogress
Various prodash types 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§

AsBStrbstr
Provide a borrowed byte-string view of common string and byte containers.
AsBStrOptbstr
Provide an optional borrowed byte-string view of common string and byte containers.

Functions§

git_is_space
Return whether byte is whitespace according to Git’s locale-independent sane_ctype table.