Struct git_ref::packed::Reference

source ·
pub struct Reference<'a> {
    pub name: &'a FullNameRef,
    pub target: &'a BStr,
    pub object: Option<&'a BStr>,
}
Expand description

A reference as parsed from the packed-refs file

Fields

name: &'a FullNameRef

The validated full name of the reference.

target: &'a BStr

The target object id of the reference, hex encoded.

object: Option<&'a BStr>

The fully peeled object id, hex encoded, that the ref is ultimately pointing to i.e. when all indirections are removed.

Implementations

Decode the target as object

Decode the object this reference is ultimately pointing to. Note that this is the target() if this is not a fully peeled reference like a tag.

Trait Implementations

Formats the value using the given formatter. Read more
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

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