Struct gix_refspec::RefSpecRef
source · pub struct RefSpecRef<'a> { /* private fields */ }
Expand description
A refspec with references to the memory it was parsed from.
Implementations§
source§impl<'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 this is a fetch spec,
or the destination
side if it is a push spec, if it is possible to do so without ambiguity.
This means it starts with refs/
. Note that it won’t contain more than two components, like refs/heads/
sourcepub fn expand_prefixes(&self, out: &mut Vec<BString>)
pub fn expand_prefixes(&self, out: &mut Vec<BString>)
As opposed to prefix()
, if the latter is None
it will expand to all possible prefixes and place them in out
.
Note that only the source
side is considered.
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.
source§impl RefSpecRef<'_>
impl RefSpecRef<'_>
Conversion
Trait Implementations§
source§impl<'a> Clone for RefSpecRef<'a>
impl<'a> Clone for RefSpecRef<'a>
source§fn clone(&self) -> RefSpecRef<'a>
fn clone(&self) -> RefSpecRef<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'a> Debug for RefSpecRef<'a>
impl<'a> Debug for RefSpecRef<'a>
source§impl From<RefSpecRef<'_>> for RefSpec
impl From<RefSpecRef<'_>> for RefSpec
source§fn from(v: RefSpecRef<'_>) -> Self
fn from(v: RefSpecRef<'_>) -> Self
source§impl Hash for RefSpecRef<'_>
impl Hash for RefSpecRef<'_>
source§impl Ord for RefSpecRef<'_>
impl Ord for RefSpecRef<'_>
source§impl PartialEq for RefSpecRef<'_>
impl PartialEq for RefSpecRef<'_>
source§impl PartialOrd for RefSpecRef<'_>
impl PartialOrd for RefSpecRef<'_>
impl<'a> Copy for RefSpecRef<'a>
impl<'a> Eq for RefSpecRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for RefSpecRef<'a>
impl<'a> RefUnwindSafe for RefSpecRef<'a>
impl<'a> Send for RefSpecRef<'a>
impl<'a> Sync for RefSpecRef<'a>
impl<'a> Unpin for RefSpecRef<'a>
impl<'a> UnwindSafe for RefSpecRef<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)