Skip to main content

Crate git_zero

Crate git_zero 

Source
Expand description

Allocation-free Git objects and HTTP client/server building blocks.

Select read, write, client and server independently. The defaults preserve the complete API. All library operations remain no_std/no-alloc.

Re-exports§

pub use git_zero_client as client;

Modules§

cache
checkout
Borrowed file contents and bounded checkout traversal for caller-owned stores.
http
HTTP values and, with server, repository routing.
io
object
pack
pktline
reader
Bounded object reads and resumable repository-format hashing. State is inline; callers own the body buffer and can retain state between individual steps.
repository
Immutable object/ref providers, HEAD states, ref validation and symbolic resolution. Fetch graph validation and selection live in validation.
snapshot
validation
Object/link validation and bounded reachable-object selection for upload-pack. ValidatedRepository shares its authenticated index with fetch history traversal. Opt-in validation of the repository graph contract, without allocation.
zlib
Allocation-free streaming zlib encoding and inflation (RFC 1950/1951). The encoder uses stored blocks; the decoder also accepts fixed and dynamic Huffman blocks, with caller-owned history and explicit expansion budgets. The decoder is implemented from RFC 1950 and RFC 1951.

Structs§

CommitIdentity
One commit identity and its recorded time. The offset does not adjust seconds.
CommitOptions
Metadata for one root commit. Message bytes are preserved, including newlines. Names and emails must be nonempty, with no control bytes or angle brackets; messages may contain newlines but not NUL. Invalid metadata returns InvalidObject.
EmptyRepository
An empty repository whose HEAD points at an unborn branch.
Entry
FetchOptions
Bounded history and object selection, sharing the ordinary graph-read budget.
File
HexId
Fixed-memory hex storage, exposing only the active 40 or 64 bytes.
HistoryPolicy
History decisions for an external, host-owned graph frontier. The host supplies the shortest commit distance from wanted roots (starting at one) and persists deduplication, exclusions and work budgets outside this value.
IndexedRepository
Index a stable repository without allocating or copying object bodies.
Object
ObjectDigest
Canonical object hashing for chunked or asynchronous storage. Updates are all-or-nothing; a length mismatch never authenticates a partial object.
ObjectHasher
Resumable Git object hashing. Retain this value between step calls; it owns a cursor and hash state but no scratch. size_of::<ObjectHasher<'_, R>>() gives the exact inline state budget for a target. IDs include kind and size.
ObjectInfo
Object metadata independent of how its body is stored. Lengths are 64-bit so generated objects need not fit in one slice, including on 32-bit hosts.
ObjectMetadata
A borrowed object and its precomputed ID, stored in caller-owned memory.
ObjectReader
A cursor over a stable repository object. It contains only a repository reference, index, metadata, and offset, with no body buffer or allocation. Use core::mem::size_of::<ObjectReader<'_, R>>() for the host’s state budget.
RefRepository
Attach a caller-owned sorted ref manifest and HEAD to an object provider. Construction validates refs and symbolic links, without reading object bodies. Use ValidatedRepository to check IDs, target kinds, tags and the union graph.
Reference
One resolved advertised ref, with optional symbolic and annotated-tag data. Symbolic targets must exist, resolve without cycles, and have the same ID. peeled is the final non-tag object ID, including through nested tags.
RevisionLimits
Additional limits for an explicitly enabled revision-history request.
RevisionOptions
Revision history, separate from absolute/relative depth. Zero is an active unrestricted revision walk. HTTP resolves exclusion refs to the iterator passed to select_revision_fetch; non-commit endpoints have no ancestry effect.
RevisionState
One caller-owned byte per repository object. Existing metadata/storage layouts remain unchanged. Recreate this descriptor for every request/retry; arrays are reset by selection, and failures invalidate all results.
SelectionOptions
Traversal budget and annotated-tag policy for a selected fetch pack.
Snapshot
A tree hierarchy and one deterministic commit with no parents. All data and storage are borrowed; construction never allocates.
SnapshotBuilder
Incrementally collect root entries in caller-owned slots, without allocation. Push accepts any arrival order; borrowed subtrees must already be assembled. Nested validation and tree/commit buffer sizing are checked when finishing.
ValidatedRepository
Validate and index a stable repository, including streaming-only providers.
ValidationMetadata
Cached identity and size of a validated object, in enumeration order.

Enums§

BlobFilter
Partial-clone object policies. Explicitly wanted objects are retained.
EntryKind
Borrowed contents and mode of a tree entry. Symlink contents are target bytes.
Error
Head
HEAD’s resolved commit and optional symbolic branch target.
ObjectFormat
One repository’s object/hash encoding. Object formats cannot be mixed.
ObjectId
A format-tagged object ID; no truncation or implicit format conversion.
ObjectKind
ShallowChange

Traits§

Repository
A stable snapshot containing the union reachable from HEAD and advertised refs.

Type Aliases§

Result