Enum git_refspec::Instruction
source · Expand description
Tells what to do and is derived from a RefSpec
.
Variants§
Implementations§
source§impl Instruction<'_>
impl Instruction<'_>
source§impl Instruction<'_>
impl Instruction<'_>
sourcepub fn to_bstring(&self) -> BString
pub fn to_bstring(&self) -> BString
Reproduce ourselves in parseable form.
sourcepub fn write_to(&self, out: impl Write) -> Result<()>
pub fn write_to(&self, out: impl Write) -> Result<()>
Serialize ourselves in a parseable format to out
.
Examples found in repository?
src/write.rs (line 18)
17 18 19 20 21 22 23 24 25 26 27 28
pub fn write_to(&self, out: impl std::io::Write) -> std::io::Result<()> {
self.instruction().write_to(out)
}
}
impl Instruction<'_> {
/// Reproduce ourselves in parseable form.
pub fn to_bstring(&self) -> BString {
let mut buf = Vec::with_capacity(128);
self.write_to(&mut buf).expect("no io error");
buf.into()
}
Trait Implementations§
source§impl<'a> Clone for Instruction<'a>
impl<'a> Clone for Instruction<'a>
source§fn clone(&self) -> Instruction<'a>
fn clone(&self) -> Instruction<'a>
Returns a copy 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 moresource§impl<'a> Debug for Instruction<'a>
impl<'a> Debug for Instruction<'a>
source§impl<'a> Hash for Instruction<'a>
impl<'a> Hash for Instruction<'a>
source§impl<'a> Ord for Instruction<'a>
impl<'a> Ord for Instruction<'a>
source§fn cmp(&self, other: &Instruction<'a>) -> Ordering
fn cmp(&self, other: &Instruction<'a>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<'a> PartialEq<Instruction<'a>> for Instruction<'a>
impl<'a> PartialEq<Instruction<'a>> for Instruction<'a>
source§fn eq(&self, other: &Instruction<'a>) -> bool
fn eq(&self, other: &Instruction<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'a> PartialOrd<Instruction<'a>> for Instruction<'a>
impl<'a> PartialOrd<Instruction<'a>> for Instruction<'a>
source§fn partial_cmp(&self, other: &Instruction<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &Instruction<'a>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<'a> Copy for Instruction<'a>
impl<'a> Eq for Instruction<'a>
impl<'a> StructuralEq for Instruction<'a>
impl<'a> StructuralPartialEq for Instruction<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Instruction<'a>
impl<'a> Send for Instruction<'a>
impl<'a> Sync for Instruction<'a>
impl<'a> Unpin for Instruction<'a>
impl<'a> UnwindSafe for Instruction<'a>
Blanket Implementations§
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more