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.
ValidatedRepositoryshares 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§
- Commit
Identity - One commit identity and its recorded time. The offset does not adjust seconds.
- Commit
Options - 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.
- Empty
Repository - An empty repository whose HEAD points at an unborn branch.
- Entry
- Fetch
Options - 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.
- History
Policy - 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.
- Indexed
Repository - Index a stable repository without allocating or copying object bodies.
- Object
- Object
Digest - Canonical object hashing for chunked or asynchronous storage. Updates are all-or-nothing; a length mismatch never authenticates a partial object.
- Object
Hasher - Resumable Git object hashing. Retain this value between
stepcalls; 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. - Object
Info - 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.
- Object
Metadata - A borrowed object and its precomputed ID, stored in caller-owned memory.
- Object
Reader - 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
ValidatedRepositoryto 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.
peeledis the final non-tag object ID, including through nested tags. - Revision
Limits - Additional limits for an explicitly enabled revision-history request.
- Revision
Options - 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. - Revision
State - 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.
- Selection
Options - 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.
- Snapshot
Builder - 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.
- Validated
Repository - Validate and index a stable repository, including streaming-only providers.
- Validation
Metadata - Cached identity and size of a validated object, in enumeration order.
Enums§
- Blob
Filter - Partial-clone object policies. Explicitly wanted objects are retained.
- Entry
Kind - Borrowed contents and mode of a tree entry. Symlink contents are target bytes.
- Error
- Head
- HEAD’s resolved commit and optional symbolic branch target.
- Object
Format - One repository’s object/hash encoding. Object formats cannot be mixed.
- Object
Id - A format-tagged object ID; no truncation or implicit format conversion.
- Object
Kind - Shallow
Change
Traits§
- Repository
- A stable snapshot containing the union reachable from HEAD and advertised refs.