pub enum EntryKind {
Tree,
Blob,
BlobExecutable,
Symlink,
Commit,
}Expand description
The five entry kinds Git allows inside a tree, each mapping to a fixed mode.
This is a closed domain used when writing trees; for reading arbitrary
trees, keep the raw TreeEntry::mode and classify with
EntryKind::from_mode (which returns None for non-canonical modes so
they round-trip rather than being silently coerced).
Variants§
Tree
A subtree (040000).
Blob
A non-executable regular file (100644).
BlobExecutable
An executable regular file (100755).
Symlink
A symbolic link (120000); the blob bytes are the link target and must
never be dereferenced.
Commit
A gitlink / submodule commit pointer (160000).
Implementations§
Source§impl EntryKind
impl EntryKind
Sourcepub const fn from_mode(mode: u32) -> Option<Self>
pub const fn from_mode(mode: u32) -> Option<Self>
Classify a raw tree-entry mode, returning None for anything that is
not one of Git’s canonical five.
Sourcepub const fn object_type(self) -> ObjectType
pub const fn object_type(self) -> ObjectType
The object type an entry of this kind points at (a gitlink points at a commit that lives in another repository).