Struct git_refspec::RefSpecRef
source · [−]pub struct RefSpecRef<'a> { /* private fields */ }
Expand description
A refspec with references to the memory it was parsed from.
Implementations
sourceimpl<'a> RefSpecRef<'a>
impl<'a> RefSpecRef<'a>
Access
sourcepub fn source(&self) -> Option<&BStr>
pub fn source(&self) -> Option<&BStr>
Return the left-hand side of the spec, typically the source. It takes many different forms so don’t rely on this being a ref name.
It’s not present in case of deletions.
sourcepub fn destination(&self) -> Option<&BStr>
pub fn destination(&self) -> Option<&BStr>
Return the right-hand side of the spec, typically the destination. It takes many different forms so don’t rely on this being a ref name.
It’s not present in case of source-only specs.
sourcepub fn remote(&self) -> Option<&BStr>
pub fn remote(&self) -> Option<&BStr>
Always returns the remote side, whose actual side in the refspec depends on how it was parsed.
sourcepub fn local(&self) -> Option<&BStr>
pub fn local(&self) -> Option<&BStr>
Always returns the local side, whose actual side in the refspec depends on how it was parsed.
sourcepub fn prefix(&self) -> Option<&BStr>
pub fn prefix(&self) -> Option<&BStr>
Derive the prefix from the source
side of this spec, if possible.
This means it starts with refs/
. Note that it won’t contain more than two components, like refs/heads/
sourcepub fn instruction(&self) -> Instruction<'a>
pub fn instruction(&self) -> Instruction<'a>
Transform the state of the refspec into an instruction making clear what to do with it.
sourceimpl RefSpecRef<'_>
impl RefSpecRef<'_>
Conversion
sourceimpl RefSpecRef<'_>
impl RefSpecRef<'_>
Trait Implementations
sourceimpl<'a> Clone for RefSpecRef<'a>
impl<'a> Clone for RefSpecRef<'a>
sourcefn clone(&self) -> RefSpecRef<'a>
fn clone(&self) -> RefSpecRef<'a>
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl<'a> Debug for RefSpecRef<'a>
impl<'a> Debug for RefSpecRef<'a>
sourceimpl From<RefSpecRef<'_>> for RefSpec
impl From<RefSpecRef<'_>> for RefSpec
sourcefn from(v: RefSpecRef<'_>) -> Self
fn from(v: RefSpecRef<'_>) -> Self
sourceimpl Hash for RefSpecRef<'_>
impl Hash for RefSpecRef<'_>
sourceimpl Ord for RefSpecRef<'_>
impl Ord for RefSpecRef<'_>
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
sourceimpl PartialEq<RefSpecRef<'_>> for RefSpecRef<'_>
impl PartialEq<RefSpecRef<'_>> for RefSpecRef<'_>
sourceimpl PartialOrd<RefSpecRef<'_>> for RefSpecRef<'_>
impl PartialOrd<RefSpecRef<'_>> for RefSpecRef<'_>
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more