pub struct RefSpec { /* private fields */ }Implementations§
Source§impl RefSpec
impl RefSpec
Sourcepub fn new(
source: Option<String>,
destination: impl Into<String>,
forced: bool,
) -> GitProjectionResult<Self>
pub fn new( source: Option<String>, destination: impl Into<String>, forced: bool, ) -> GitProjectionResult<Self>
Construct a refspec after enforcing reserved-remote-name invariants.
Sourcepub fn forced(
source: impl Into<String>,
destination: impl Into<String>,
) -> GitProjectionResult<Self>
pub fn forced( source: impl Into<String>, destination: impl Into<String>, ) -> GitProjectionResult<Self>
A forced (+) refspec mapping source onto destination.
Sourcepub fn delete(destination: impl Into<String>) -> GitProjectionResult<Self>
pub fn delete(destination: impl Into<String>) -> GitProjectionResult<Self>
A delete refspec (:destination). Not forced: deleting a destination
that has no source cannot lose work.
Sourcepub fn to_git_format(&self) -> String
pub fn to_git_format(&self) -> String
Render in git refspec syntax, including the leading + when forced.
Sourcepub fn to_git_format_not_forced(&self) -> String
pub fn to_git_format_not_forced(&self) -> String
Render in git refspec syntax without the leading +, even when forced.
Trait Implementations§
impl Eq for RefSpec
impl StructuralPartialEq for RefSpec
Auto Trait Implementations§
impl Freeze for RefSpec
impl RefUnwindSafe for RefSpec
impl Send for RefSpec
impl Sync for RefSpec
impl Unpin for RefSpec
impl UnsafeUnpin for RefSpec
impl UnwindSafe for RefSpec
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