Struct git_revision::describe::Format
source · [−]pub struct Format<'a> {
pub name: Option<Cow<'a, BStr>>,
pub id: ObjectId,
pub hex_len: usize,
pub depth: u32,
pub long: bool,
pub dirty_suffix: Option<String>,
}
Expand description
A structure implementing Display
, producing a git describe
like string.
Fields
name: Option<Cow<'a, BStr>>
The name of the branch or tag to display, as is.
If None
, the id
will be displayed as a fallback.
id: ObjectId
The id
of the commit to describe.
hex_len: usize
The amount of hex characters to use to display id
.
depth: u32
The amount of commits between name
and id
, where id
is in the future of name
.
long: bool
If true, the long form of the describe string will be produced even if id
lies directly on name
,
hence has a depth of 0.
dirty_suffix: Option<String>
If Some(suffix)
, it will be appended to the describe string.
This should be set if the working tree was determined to be dirty.
Implementations
sourceimpl<'a> Format<'a>
impl<'a> Format<'a>
sourcepub fn is_exact_match(&self) -> bool
pub fn is_exact_match(&self) -> bool
Return true if the name
is directly associated with id
, i.e. there are no commits between them.
Trait Implementations
sourceimpl<'a> Ord for Format<'a>
impl<'a> Ord for Format<'a>
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<'a> PartialEq<Format<'a>> for Format<'a>
impl<'a> PartialEq<Format<'a>> for Format<'a>
sourceimpl<'a> PartialOrd<Format<'a>> for Format<'a>
impl<'a> PartialOrd<Format<'a>> for Format<'a>
sourcefn partial_cmp(&self, other: &Format<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &Format<'a>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl<'a> Eq for Format<'a>
impl<'a> StructuralEq for Format<'a>
impl<'a> StructuralPartialEq for Format<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for Format<'a>
impl<'a> Send for Format<'a>
impl<'a> Sync for Format<'a>
impl<'a> Unpin for Format<'a>
impl<'a> UnwindSafe for Format<'a>
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