Struct GitRefspec
pub struct GitRefspec { /* private fields */ }Expand description
A lightweight refspec model.
Implementations§
§impl GitRefspec
impl GitRefspec
pub const fn new(
source: RefspecSource,
destination: Option<RefspecDestination>,
direction: RefspecDirection,
mode: RefspecMode,
) -> GitRefspec
pub const fn new( source: RefspecSource, destination: Option<RefspecDestination>, direction: RefspecDirection, mode: RefspecMode, ) -> GitRefspec
Creates a refspec from parts.
pub fn parse(value: impl AsRef<str>) -> Result<GitRefspec, RefspecParseError>
pub fn parse(value: impl AsRef<str>) -> Result<GitRefspec, RefspecParseError>
Parses a fetch-oriented refspec from text.
§Errors
Returns RefspecParseError when the refspec is empty or malformed.
pub fn parse_with_direction(
value: impl AsRef<str>,
direction: RefspecDirection,
) -> Result<GitRefspec, RefspecParseError>
pub fn parse_with_direction( value: impl AsRef<str>, direction: RefspecDirection, ) -> Result<GitRefspec, RefspecParseError>
Parses a refspec from text with explicit direction vocabulary.
§Errors
Returns RefspecParseError when the refspec is empty or malformed.
pub const fn source(&self) -> &RefspecSource
pub const fn source(&self) -> &RefspecSource
Returns the source side.
pub const fn destination(&self) -> Option<&RefspecDestination>
pub const fn destination(&self) -> Option<&RefspecDestination>
Returns the destination side when present.
pub const fn direction(&self) -> RefspecDirection
pub const fn direction(&self) -> RefspecDirection
Returns the direction vocabulary.
pub const fn mode(&self) -> RefspecMode
pub const fn mode(&self) -> RefspecMode
Returns the force mode vocabulary.
pub fn is_wildcard(&self) -> bool
pub fn is_wildcard(&self) -> bool
Returns true when either side contains *.
Trait Implementations§
§impl Clone for GitRefspec
impl Clone for GitRefspec
§fn clone(&self) -> GitRefspec
fn clone(&self) -> GitRefspec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for GitRefspec
impl Debug for GitRefspec
§impl Display for GitRefspec
impl Display for GitRefspec
§impl FromStr for GitRefspec
impl FromStr for GitRefspec
§type Err = RefspecParseError
type Err = RefspecParseError
The associated error which can be returned from parsing.
§fn from_str(value: &str) -> Result<GitRefspec, <GitRefspec as FromStr>::Err>
fn from_str(value: &str) -> Result<GitRefspec, <GitRefspec as FromStr>::Err>
Parses a string
s to return a value of this type. Read more§impl PartialEq for GitRefspec
impl PartialEq for GitRefspec
impl Eq for GitRefspec
impl StructuralPartialEq for GitRefspec
Auto Trait Implementations§
impl Freeze for GitRefspec
impl RefUnwindSafe for GitRefspec
impl Send for GitRefspec
impl Sync for GitRefspec
impl Unpin for GitRefspec
impl UnsafeUnpin for GitRefspec
impl UnwindSafe for GitRefspec
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
Mutably borrows from an owned value. Read more