pub struct Object<'repo> { /* fields omitted */ }
A structure to represent a git object
Get the id (SHA1) of a repository object
Get the object type of an object.
If the type is unknown, then None
is returned.
Recursively peel an object until an object of the specified type is met.
If you pass Any
as the target type, then the object will be
peeled until the type changes (e.g. a tag will be chased until the
referenced object is no longer a tag).
Recursively peel an object until a blob is found
Recursively peel an object until a commit is found
Recursively peel an object until a tag is found
Recursively peel an object until a tree is found
Get a short abbreviated OID string for the object
This starts at the "core.abbrev" length (default 7 characters) and
iteratively extends to a longer string if that length is ambiguous. The
result will be unambiguous (at least until new objects are added to the
repository).
Attempt to view this object as a commit.
Returns None
if the object is not actually a commit.
Attempt to consume this object and return a commit.
Returns Err(self)
if this object is not actually a commit.
Attempt to view this object as a tag.
Returns None
if the object is not actually a tag.
Attempt to consume this object and return a tag.
Returns Err(self)
if this object is not actually a tag.
Attempt to view this object as a tree.
Returns None
if the object is not actually a tree.
Attempt to consume this object and return a tree.
Returns Err(self)
if this object is not actually a tree.
Attempt to view this object as a blob.
Returns None
if the object is not actually a blob.
Attempt to consume this object and return a blob.
Returns Err(self)
if this object is not actually a blob.
Describes a commit
Performs a describe operation on this commitish object.
Executes the destructor for this type. Read more
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static