Skip to main content

ForEachRefFormatContext

Struct ForEachRefFormatContext 

Source
pub struct ForEachRefFormatContext<'a> {
Show 28 fields pub git_dir: &'a Path, pub db: &'a FileObjectDatabase, pub format: ObjectFormat, pub refname: &'a str, pub oid: &'a ObjectId, pub deltabase: &'a ObjectId, pub object_type: ObjectType, pub object_body: &'a [u8], pub object_size: usize, pub object_disk_size: Option<u64>, pub color: bool, pub quote: ForEachRefQuoteMode, pub objectname_abbrev: Option<usize>, pub objectname_candidates: &'a [ObjectId], pub worktree_path: Option<&'a str>, pub is_head: bool, pub symref: Option<&'a str>, pub upstream: Option<ForEachRefUpstream>, pub push: Option<ForEachRefPush>, pub upstream_track: Option<ForEachRefTrack>, pub push_track: Option<ForEachRefTrack>, pub contents: Option<ForEachRefContents<'a>>, pub peeled_object: Option<ForEachRefPeeledObject<'a>>, pub signature: Option<&'a dyn ForEachRefSignatureVerification>, pub peeled_signature: Option<&'a dyn ForEachRefSignatureVerification>, pub mailmap: &'a dyn ForEachRefMailmapRewrite, pub ref_names: &'a HashSet<String>, pub warn_ambiguous_refs: bool,
}

Fields§

§git_dir: &'a Path§db: &'a FileObjectDatabase§format: ObjectFormat§refname: &'a str§oid: &'a ObjectId§deltabase: &'a ObjectId§object_type: ObjectType§object_body: &'a [u8]§object_size: usize§object_disk_size: Option<u64>§color: bool§quote: ForEachRefQuoteMode§objectname_abbrev: Option<usize>§objectname_candidates: &'a [ObjectId]§worktree_path: Option<&'a str>§is_head: bool§symref: Option<&'a str>§upstream: Option<ForEachRefUpstream>§push: Option<ForEachRefPush>§upstream_track: Option<ForEachRefTrack>§push_track: Option<ForEachRefTrack>§contents: Option<ForEachRefContents<'a>>§peeled_object: Option<ForEachRefPeeledObject<'a>>§signature: Option<&'a dyn ForEachRefSignatureVerification>§peeled_signature: Option<&'a dyn ForEachRefSignatureVerification>§mailmap: &'a dyn ForEachRefMailmapRewrite§ref_names: &'a HashSet<String>§warn_ambiguous_refs: bool

Implementations§

Source§

impl ForEachRefFormatContext<'_>

Source

pub fn shorten_ref(&self, refname: &str) -> String

Shorten a fully-qualified refname to its unambiguous abbreviation, the way git’s %(refname:short) / %(symref:short) / %(upstream:short) do.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.