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 there is no more object to follow, and return that object id.

Returns None if the head is unborn.

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

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

Performs the conversion.

Performs the conversion.

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.