pub struct SourceSymbolIdentity { /* private fields */ }Expand description
Typed identity shared by source, data, corroboration, and Explore projections.
language is absent only for a data-only symbol whose source parser did not emit a language-
specific symbol. Callers compare Self::location_key when they need to join those two views.
Implementations§
Source§impl SourceSymbolIdentity
impl SourceSymbolIdentity
Sourcepub fn new(
repository: RepoId,
language: impl Into<String>,
source_path: impl Into<String>,
symbol: impl Into<String>,
) -> Self
pub fn new( repository: RepoId, language: impl Into<String>, source_path: impl Into<String>, symbol: impl Into<String>, ) -> Self
Creates a language-specific source symbol.
Sourcepub fn data(
repository: RepoId,
source_path: impl Into<String>,
symbol: impl Into<String>,
) -> Self
pub fn data( repository: RepoId, source_path: impl Into<String>, symbol: impl Into<String>, ) -> Self
Creates a data-only source symbol when no language-specific node exists.
Sourcepub fn from_node(node: &Node) -> Option<Self>
pub fn from_node(node: &Node) -> Option<Self>
Parses either canonical persisted symbol representation without consulting its display label.
Sourcepub const fn repository(&self) -> &RepoId
pub const fn repository(&self) -> &RepoId
Repository owning the source artifact.
Sourcepub fn language(&self) -> Option<&str>
pub fn language(&self) -> Option<&str>
Normalized source language, absent for data-only fallback identities.
Sourcepub fn source_path(&self) -> &str
pub fn source_path(&self) -> &str
Portable repository-relative source path.
Sourcepub fn location_key(&self) -> (&RepoId, &str, &str)
pub fn location_key(&self) -> (&RepoId, &str, &str)
Stable comparison key that deliberately ignores the optional language dimension.
Sourcepub fn stable_key(&self) -> String
pub fn stable_key(&self) -> String
Canonical persisted key.
Trait Implementations§
Source§impl Clone for SourceSymbolIdentity
impl Clone for SourceSymbolIdentity
Source§impl Debug for SourceSymbolIdentity
impl Debug for SourceSymbolIdentity
impl Eq for SourceSymbolIdentity
Source§impl Hash for SourceSymbolIdentity
impl Hash for SourceSymbolIdentity
Source§impl Ord for SourceSymbolIdentity
impl Ord for SourceSymbolIdentity
1.21.0 (const: unstable) · 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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for SourceSymbolIdentity
impl PartialEq for SourceSymbolIdentity
Source§impl PartialOrd for SourceSymbolIdentity
impl PartialOrd for SourceSymbolIdentity
impl StructuralPartialEq for SourceSymbolIdentity
Auto Trait Implementations§
impl Freeze for SourceSymbolIdentity
impl RefUnwindSafe for SourceSymbolIdentity
impl Send for SourceSymbolIdentity
impl Sync for SourceSymbolIdentity
impl Unpin for SourceSymbolIdentity
impl UnsafeUnpin for SourceSymbolIdentity
impl UnwindSafe for SourceSymbolIdentity
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
Compare self to
key and return true if they are equal.