pub enum ObjectType {
Show 18 variants
Commit = 1,
Tree = 2,
Blob = 3,
Tag = 4,
OffsetZstdelta = 5,
OffsetDelta = 6,
HashDelta = 7,
ContextSnapshot = 8,
Decision = 9,
Evidence = 10,
PatchSet = 11,
Plan = 12,
Provenance = 13,
Run = 14,
Task = 15,
Intent = 16,
ToolInvocation = 17,
ContextPipeline = 18,
}Expand description
In Git, each object type is assigned a unique integer value, which is used to identify the type of the object in Git repositories.
Blob(1): A Git object that stores the content of a file.Tree(2): A Git object that represents a directory or a folder in a Git repository.Commit(3): A Git object that represents a commit in a Git repository, which contains information such as the author, committer, commit message, and parent commits.Tag(4): A Git object that represents a tag in a Git repository, which is used to mark a specific point in the Git history.OffsetDelta(6): A Git object that represents a delta between two objects, where the delta is stored as an offset to the base object.HashDelta(7): A Git object that represents a delta between two objects, where the delta is stored as a hash of the base object.
By assigning unique integer values to each Git object type, Git can easily and efficiently identify the type of an object and perform the appropriate operations on it. when parsing a Git repository, Git can use the integer value of an object’s type to determine how to parse the object’s content.
Variants§
Commit = 1
Tree = 2
Blob = 3
Tag = 4
OffsetZstdelta = 5
OffsetDelta = 6
HashDelta = 7
ContextSnapshot = 8
Decision = 9
Evidence = 10
PatchSet = 11
Plan = 12
Provenance = 13
Run = 14
Task = 15
Intent = 16
ToolInvocation = 17
ContextPipeline = 18
Implementations§
Source§impl ObjectType
Display trait for Git objects type
impl ObjectType
Display trait for Git objects type
Sourcepub fn to_pack_type_u8(&self) -> Result<u8, GitError>
pub fn to_pack_type_u8(&self) -> Result<u8, GitError>
Convert object type to 3-bit pack header type id.
Git pack headers only carry 3 type bits (values 0..=7). AI object types are not representable in this field and must not be written as regular base objects in a pack entry.
Sourcepub fn from_pack_type_u8(number: u8) -> Result<ObjectType, GitError>
pub fn from_pack_type_u8(number: u8) -> Result<ObjectType, GitError>
Decode 3-bit pack header type id to object type.
Sourcepub fn to_bytes(&self) -> Option<&[u8]>
pub fn to_bytes(&self) -> Option<&[u8]>
Returns the loose-object type header bytes (e.g. b"commit", b"blob").
Delta types (OffsetDelta, HashDelta, OffsetZstdelta) only
exist inside pack files and have no loose-object representation.
Passing a delta type is a logic error and returns None.
Sourcepub fn from_string(s: &str) -> Result<ObjectType, GitError>
pub fn from_string(s: &str) -> Result<ObjectType, GitError>
Parses a string representation of a Git object type and returns an ObjectType value
Sourcepub fn is_base(&self) -> bool
pub fn is_base(&self) -> bool
Returns true if this type is a base Git object that can appear
as a delta target in pack files. AI object types return false
because they cannot be encoded in pack files and should never
participate in delta window selection.
Sourcepub fn is_ai_object(&self) -> bool
pub fn is_ai_object(&self) -> bool
Returns true if this type is an AI extension object (not representable
in the 3-bit Git pack header).
Trait Implementations§
Source§impl Clone for ObjectType
impl Clone for ObjectType
Source§fn clone(&self) -> ObjectType
fn clone(&self) -> ObjectType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ObjectType
impl Debug for ObjectType
Source§impl<'de> Deserialize<'de> for ObjectType
impl<'de> Deserialize<'de> for ObjectType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for ObjectType
Display trait for Git objects type
impl Display for ObjectType
Display trait for Git objects type
Source§impl Hash for ObjectType
impl Hash for ObjectType
Source§impl PartialEq for ObjectType
impl PartialEq for ObjectType
Source§impl Serialize for ObjectType
impl Serialize for ObjectType
impl Copy for ObjectType
impl Eq for ObjectType
impl StructuralPartialEq for ObjectType
Auto Trait Implementations§
impl Freeze for ObjectType
impl RefUnwindSafe for ObjectType
impl Send for ObjectType
impl Sync for ObjectType
impl Unpin for ObjectType
impl UnsafeUnpin for ObjectType
impl UnwindSafe for ObjectType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FileLoadStore for Twhere
T: Serialize + for<'a> Deserialize<'a>,
impl<T> FileLoadStore for Twhere
T: Serialize + for<'a> Deserialize<'a>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more