Skip to main content

Crate sley_object

Crate sley_object 

Source
Expand description

git-object — Git’s object model: commits, trees, tags, and the raw encoded object framing they share.

This crate carries the in-memory representations of Git’s four object types (Commit, Tree, Tag, and the blob payload carried inside EncodedObject) together with their parse/serialize routines and the parse_framed_object helper that decodes the "<type> <len>\0<body>" loose-object frame.

Commit and Tag are parsed, canonical representations of the headers this crate understands. They are convenient for structured edits, but they are not byte-lossless round-trippers for signed objects, custom headers, or other raw object body details. Use EncodedObject whenever exact object bytes, object ids, or framed-object bytes must be preserved.

Structs§

BString
A byte string for git paths and similar on-disk identifiers.
Commit
A parsed, canonical representation of the commit headers this crate understands.
CommitRef
A borrowed parse-view of a raw commit object.
EncodedObject
Tag
A parsed, canonical representation of the annotated tag headers this crate understands.
TagRef
A borrowed parse-view of a raw annotated tag object.
Tree
TreeBuilder
Builds a single tree level: deduplicates entries by name and emits them in Git’s canonical order so the written object is byte-identical to Git’s.
TreeEntries
Fallibly iterates raw tree-object bytes without allocating entry names.
TreeEntry
TreeEntryRef
A borrowed parse-view of a single entry in a raw tree object.

Enums§

EntryKind
The five entry kinds Git allows inside a tree, each mapping to a fixed mode.
ObjectType

Functions§

parse_framed_object
tree_entry_cmp
Order two tree entries the way Git canonically sorts them: by name bytes, except that a subtree sorts as though its name ended in /. Writing a tree whose entries are in any other order produces a different (wrong) OID.
tree_entry_object_type