pub struct AliasIndex { /* private fields */ }Expand description
One project-wide index from every accepted alias to a canonical issue reference.
The index is built once per read operation. Numbers, filenames, and titles are aliases; ids are identity. Duplicate ids are recorded and make the index unusable for graph work rather than allowing one file to shadow another.
Implementations§
Source§impl AliasIndex
impl AliasIndex
Sourcepub fn scanned_nodes(&self) -> usize
pub fn scanned_nodes(&self) -> usize
How many issue records the single index-building pass examined.
Sourcepub fn build<N: IdentityNode>(nodes: &[N]) -> Self
pub fn build<N: IdentityNode>(nodes: &[N]) -> Self
Build the complete alias index over one issue snapshot.
Sourcepub fn duplicate_ids(&self) -> &BTreeMap<String, Vec<u32>>
pub fn duplicate_ids(&self) -> &BTreeMap<String, Vec<u32>>
Every duplicated canonical id, in stable order.
Sourcepub fn duplicate_id_files(&self) -> &BTreeMap<String, Vec<String>>
pub fn duplicate_id_files(&self) -> &BTreeMap<String, Vec<String>>
Every filename claiming each duplicated canonical id, in stable order.
Sourcepub fn duplicate_records(&self) -> &[DuplicateIdentityRecord]
pub fn duplicate_records(&self) -> &[DuplicateIdentityRecord]
One record per file claiming a duplicated canonical id.
Sourcepub fn resolve(&self, reference: &IssueRef) -> Result<IssueRef, AliasError>
pub fn resolve(&self, reference: &IssueRef) -> Result<IssueRef, AliasError>
Resolve a stored graph reference or selector alias to one canonical reference.
Sourcepub fn resolve_number(&self, number: u32) -> Result<IssueRef, AliasError>
pub fn resolve_number(&self, number: u32) -> Result<IssueRef, AliasError>
Resolve a numeric alias, refusing ambiguity.
Sourcepub fn resolve_filename(&self, filename: &str) -> Result<IssueRef, AliasError>
pub fn resolve_filename(&self, filename: &str) -> Result<IssueRef, AliasError>
Resolve an exact filename alias, refusing ambiguity.
Sourcepub fn resolve_title(&self, title: &str) -> Result<IssueRef, AliasError>
pub fn resolve_title(&self, title: &str) -> Result<IssueRef, AliasError>
Resolve an exact title alias, refusing ambiguity.
Trait Implementations§
Source§impl Clone for AliasIndex
impl Clone for AliasIndex
Source§impl Debug for AliasIndex
impl Debug for AliasIndex
Source§impl Default for AliasIndex
impl Default for AliasIndex
impl Eq for AliasIndex
Source§impl PartialEq for AliasIndex
impl PartialEq for AliasIndex
impl StructuralPartialEq for AliasIndex
Auto Trait Implementations§
impl Freeze for AliasIndex
impl RefUnwindSafe for AliasIndex
impl Send for AliasIndex
impl Sync for AliasIndex
impl Unpin for AliasIndex
impl UnsafeUnpin for AliasIndex
impl UnwindSafe for AliasIndex
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> ⓘ
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> ⓘ
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