pub struct Head<'repo> {
    pub kind: Kind,
    /* private fields */
}
Expand description

The head reference, as created from looking at .git/HEAD, able to represent all of its possible states.

Note that like Reference, this type’s data is snapshot of persisted state on disk.

Fields

kind: Kind

One of various possible states for the HEAD reference

Implementations

Return a platform for obtaining iterators on the reference log associated with the HEAD reference.

Peel this instance to make obtaining its final target id possible, while returning an error on unborn heads.

Follow the symbolic reference of this head until its target object and peel it by following tag objects until there is no more object to follow, and return that object id.

Returns None if the head is unborn.

Follow the symbolic reference of this head until its target object and peel it by following tag objects until there is no more object to follow, transform the id into a commit if possible and return that.

Returns an error if the head is unborn or if it doesn’t point to a commit.

Consume this instance and transform it into the final object that it points to, or None if the HEAD reference is yet to be born.

Returns the name of this references, always HEAD.

Returns the full reference name of this head if it is not detached, or None otherwise.

Returns true if this instance is detached, and points to an object directly.

Returns the id the head points to, which isn’t possible on unborn heads.

Force transforming this instance into the symbolic reference that it points to, or panic if it is unborn or detached.

Panics

If this isn’t actually a head pointing to a symbolic reference.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.