Struct git2::Object [] [src]

pub struct Object<'repo> { /* fields omitted */ }

A structure to represent a git object

Methods

impl<'repo> Object<'repo>
[src]

[src]

Get the id (SHA1) of a repository object

[src]

Get the object type of an object.

If the type is unknown, then None is returned.

[src]

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).

[src]

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).

[src]

Attempt to view this object as a commit.

Returns None if the object is not actually a commit.

[src]

Attempt to consume this object and return a commit.

Returns Err(self) if this object is not actually a commit.

[src]

Attempt to view this object as a tag.

Returns None if the object is not actually a tag.

[src]

Attempt to consume this object and return a tag.

Returns Err(self) if this object is not actually a tag.

[src]

Attempt to view this object as a tree.

Returns None if the object is not actually a tree.

[src]

Attempt to consume this object and return a tree.

Returns Err(self) if this object is not actually a tree.

[src]

Attempt to view this object as a blob.

Returns None if the object is not actually a blob.

[src]

Attempt to consume this object and return a blob.

Returns Err(self) if this object is not actually a blob.

[src]

Describes a commit

Performs a describe operation on this commitish object.

Trait Implementations

impl<'repo> Clone for Object<'repo>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<'repo> Drop for Object<'repo>
[src]

[src]

Executes the destructor for this type. Read more