pub struct Refspec<'remote> { /* private fields */ }
Expand description
A structure to represent a git refspec.
Refspecs are currently mainly accessed/created through a Remote
.
Implementations
sourceimpl<'remote> Refspec<'remote>
impl<'remote> Refspec<'remote>
sourcepub fn dst(&self) -> Option<&str>
pub fn dst(&self) -> Option<&str>
Get the destination specifier.
If the destination is not utf-8, None is returned.
sourcepub fn dst_bytes(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn dst_bytes(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
Get the destination specifier, in bytes.
sourcepub fn dst_matches(&self, refname: &str) -> bool
pub fn dst_matches(&self, refname: &str) -> bool
Check if a refspec’s destination descriptor matches a reference
sourcepub fn src(&self) -> Option<&str>
pub fn src(&self) -> Option<&str>
Get the source specifier.
If the source is not utf-8, None is returned.
sourcepub fn src_bytes(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn src_bytes(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
Get the source specifier, in bytes.
sourcepub fn src_matches(&self, refname: &str) -> bool
pub fn src_matches(&self, refname: &str) -> bool
Check if a refspec’s source descriptor matches a reference
sourcepub fn str(&self) -> Option<&str>
pub fn str(&self) -> Option<&str>
Get the refspec’s string.
Returns None if the string is not valid utf8.
sourcepub fn bytes(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn bytes(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
Get the refspec’s string as a byte array
Auto Trait Implementations
impl<'remote> RefUnwindSafe for Refspec<'remote>
impl<'remote> !Send for Refspec<'remote>
impl<'remote> !Sync for Refspec<'remote>
impl<'remote> Unpin for Refspec<'remote>
impl<'remote> UnwindSafe for Refspec<'remote>
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