Struct git_repository::Reference
source · [−]pub struct Reference<'r> {
pub inner: Reference,
/* private fields */
}
Expand description
A reference that points to an object or reference, with access to its source repository.
Note that these are snapshots and won’t recognize if they are stale.
Fields
inner: Reference
The actual reference data
Implementations
sourceimpl<'repo> Reference<'repo>
impl<'repo> Reference<'repo>
sourcepub fn try_id(&self) -> Option<Id<'repo>>
pub fn try_id(&self) -> Option<Id<'repo>>
Returns the attached id we point to, or None
if this is a symbolic ref.
sourcepub fn id(&self) -> Id<'repo>
pub fn id(&self) -> Id<'repo>
Returns the attached id we point to, or panic if this is a symbolic ref.
sourcepub fn peel_to_id_in_place(&mut self) -> Result<Id<'repo>, Error>
pub fn peel_to_id_in_place(&mut self) -> Result<Id<'repo>, Error>
Follow all symbolic targets this reference might point to and peel the underlying object to the end of the chain, and return it.
This is useful to learn where this reference is ulitmately pointing to.
sourcepub fn into_fully_peeled_id(self) -> Result<Id<'repo>, Error>
pub fn into_fully_peeled_id(self) -> Result<Id<'repo>, Error>
Similar to peel_to_id_in_place()
, but consumes this instance.
Trait Implementations
Auto Trait Implementations
impl<'r> !RefUnwindSafe for Reference<'r>
impl<'r> !Send for Reference<'r>
impl<'r> !Sync for Reference<'r>
impl<'r> Unpin for Reference<'r>
impl<'r> !UnwindSafe for Reference<'r>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more