pub struct IdPrefixIndex<'a> { /* private fields */ }
Expand description
Loaded index to disambiguate commit/change IDs.
Implementations§
Source§impl IdPrefixIndex<'_>
impl IdPrefixIndex<'_>
Sourcepub const fn empty() -> IdPrefixIndex<'static>
pub const fn empty() -> IdPrefixIndex<'static>
Returns an empty index that just falls back to a provided repo
.
Sourcepub fn resolve_commit_prefix(
&self,
repo: &dyn Repo,
prefix: &HexPrefix,
) -> PrefixResolution<CommitId>
pub fn resolve_commit_prefix( &self, repo: &dyn Repo, prefix: &HexPrefix, ) -> PrefixResolution<CommitId>
Resolve an unambiguous commit ID prefix.
Sourcepub fn shortest_commit_prefix_len(
&self,
repo: &dyn Repo,
commit_id: &CommitId,
) -> usize
pub fn shortest_commit_prefix_len( &self, repo: &dyn Repo, commit_id: &CommitId, ) -> usize
Returns the shortest length of a prefix of commit_id
that can still be
resolved by resolve_commit_prefix()
and SymbolResolver
.
pub fn shortest_commit_prefix_len_exact( &self, repo: &dyn Repo, commit_id: &CommitId, ) -> usize
Sourcepub fn resolve_change_prefix(
&self,
repo: &dyn Repo,
prefix: &HexPrefix,
) -> PrefixResolution<Vec<CommitId>>
pub fn resolve_change_prefix( &self, repo: &dyn Repo, prefix: &HexPrefix, ) -> PrefixResolution<Vec<CommitId>>
Resolve an unambiguous change ID prefix to the commit IDs in the revset.
Sourcepub fn shortest_change_prefix_len(
&self,
repo: &dyn Repo,
change_id: &ChangeId,
) -> usize
pub fn shortest_change_prefix_len( &self, repo: &dyn Repo, change_id: &ChangeId, ) -> usize
Returns the shortest length of a prefix of change_id
that can still be
resolved by resolve_change_prefix()
and SymbolResolver
.
Auto Trait Implementations§
impl<'a> Freeze for IdPrefixIndex<'a>
impl<'a> RefUnwindSafe for IdPrefixIndex<'a>
impl<'a> Send for IdPrefixIndex<'a>
impl<'a> Sync for IdPrefixIndex<'a>
impl<'a> Unpin for IdPrefixIndex<'a>
impl<'a> UnwindSafe for IdPrefixIndex<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more