[][src]Struct git2::Refspec

pub struct Refspec<'remote> { /* fields omitted */ }

A structure to represent a git refspec.

Refspecs are currently mainly accessed/created through a Remote.

Implementations

impl<'remote> Refspec<'remote>[src]

pub fn direction(&self) -> Direction[src]

Get the refspec's direction.

pub fn dst(&self) -> Option<&str>[src]

Get the destination specifier.

If the destination is not utf-8, None is returned.

pub fn dst_bytes(&self) -> &[u8]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Get the destination specifier, in bytes.

pub fn dst_matches(&self, refname: &str) -> bool[src]

Check if a refspec's destination descriptor matches a reference

pub fn src(&self) -> Option<&str>[src]

Get the source specifier.

If the source is not utf-8, None is returned.

pub fn src_bytes(&self) -> &[u8]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Get the source specifier, in bytes.

pub fn src_matches(&self, refname: &str) -> bool[src]

Check if a refspec's source descriptor matches a reference

pub fn is_force(&self) -> bool[src]

Get the force update setting.

pub fn str(&self) -> Option<&str>[src]

Get the refspec's string.

Returns None if the string is not valid utf8.

pub fn bytes(&self) -> &[u8]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Get the refspec's string as a byte array

pub fn transform(&self, name: &str) -> Result<Buf, Error>[src]

Transform a reference to its target following the refspec's rules

pub fn rtransform(&self, name: &str) -> Result<Buf, Error>[src]

Transform a target reference to its source reference following the refspec's rules

Auto Trait Implementations

impl<'remote> RefUnwindSafe for Refspec<'remote>[src]

impl<'remote> !Send for Refspec<'remote>[src]

impl<'remote> !Sync for Refspec<'remote>[src]

impl<'remote> Unpin for Refspec<'remote>[src]

impl<'remote> UnwindSafe for Refspec<'remote>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.