Expand description
This crate provides types for read-only git objects backed by bytes provided in git’s serialization format as well as mutable versions of these. Both types of objects can be encoded.
§Feature Flags
Modules§
- bstr
- A byte string library.
- commit
- data
- Contains a borrowed Object bound to a buffer holding its decompressed data.
- date
- Date and time parsing similar to what git can do.
- decode
- encode
- Encoding utilities
- find
- kind
- tag
- tree
- write
Structs§
- Blob
- A mutable chunk of any
data. - BlobRef
- A chunk of any
data. - Commit
- A mutable git commit, representing an annotated state of a working tree along with a reference to its historical commits.
- Commit
Ref - A git commit parsed using
from_bytes(). - Commit
RefIter - Like
CommitRef, but asIteratorto support (up to) entirely allocation free parsing. It’s particularly useful to traverse the commit graph without ever allocating arrays for parents. - Data
- A borrowed object using a slice as backing buffer, or in other words a bytes buffer that knows the kind of object it represents.
- Header
- Information about an object, which includes its kind and the amount of bytes it would have when obtained.
- Tag
- A mutable git tag.
- TagRef
- Represents a git tag, commonly indicating a software release.
- TagRef
Iter - Like
TagRef, but asIteratorto support entirely allocation free parsing. It’s particularly useful to dereference only the target chain. - Tree
- A mutable Tree, containing other trees, blobs or commits.
- TreeRef
- A directory snapshot containing files (blobs), directories (trees) and submodules (commits).
- Tree
RefIter - A directory snapshot containing files (blobs), directories (trees) and submodules (commits), lazily evaluated.
Enums§
- Kind
- The four types of objects that git differentiates.
- Object
- Mutable objects with each field being separately allocated and changeable.
- Object
Ref - Immutable objects are read-only structures referencing most data from a byte slice.
Traits§
- Exists
- Check if an object is present in an object store.
- Find
- Find an object in the object store.
- FindExt
- An extension trait with convenience functions.
- Find
Header - Find the header of an object in the object store.
- Find
Object OrHeader - A combination of
FindandHeadertraits to help withdyntrait objects. - Header
Ext - An extension trait with convenience functions.
- Write
- Describe the capability to write git objects into an object store.
- WriteTo
- Writing of objects to a
Writeimplementation
Functions§
- compute_
hash - A function to compute a hash of kind
hash_kindfor an object ofobject_kindand itsdata. - compute_
stream_ hash - A function to compute a hash of kind
hash_kindfor an object ofobject_kindand its data read fromstreamwhich has to yield exactlystream_lenbytes. Useprogressto learn about progress in bytes processed andshould_interruptto be able to abort the operation if set totrue.