pub struct SymbolId {
pub kind: SymbolKind,
pub path: Vec<String>,
pub disambiguator: u32,
}Expand description
Stable, unique identifier for symbols that persists across all pipeline stages
Fields§
§kind: SymbolKind§path: Vec<String>§disambiguator: u32Implementations§
Source§impl SymbolId
impl SymbolId
Sourcepub fn new(kind: SymbolKind, path: Vec<String>) -> Self
pub fn new(kind: SymbolKind, path: Vec<String>) -> Self
Create a new symbol ID with path and kind
Sourcepub fn with_disambiguator(
kind: SymbolKind,
path: Vec<String>,
disambiguator: u32,
) -> Self
pub fn with_disambiguator( kind: SymbolKind, path: Vec<String>, disambiguator: u32, ) -> Self
Create a new symbol ID with disambiguation
Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Check if this is an unknown/default symbol ID
Sourcepub fn endpoint_id(path: Vec<String>) -> Self
pub fn endpoint_id(path: Vec<String>) -> Self
Create a symbol ID for an endpoint/function
Sourcepub fn variant_id(enum_path: Vec<String>, variant_name: String) -> Self
pub fn variant_id(enum_path: Vec<String>, variant_name: String) -> Self
Create a symbol ID for a variant
Sourcepub fn field_id(parent_path: Vec<String>, field_name: String) -> Self
pub fn field_id(parent_path: Vec<String>, field_name: String) -> Self
Create a symbol ID for a field
Sourcepub fn qualified_name(&self) -> String
pub fn qualified_name(&self) -> String
Get the qualified name as a “::” separated string
Sourcepub fn same_symbol(&self, other: &SymbolId) -> bool
pub fn same_symbol(&self, other: &SymbolId) -> bool
Check if this is the same symbol (ignoring disambiguator)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SymbolId
impl<'de> Deserialize<'de> for SymbolId
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for SymbolId
impl Ord for SymbolId
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
Source§impl PartialOrd for SymbolId
impl PartialOrd for SymbolId
impl Eq for SymbolId
impl StructuralPartialEq for SymbolId
Auto Trait Implementations§
impl Freeze for SymbolId
impl RefUnwindSafe for SymbolId
impl Send for SymbolId
impl Sync for SymbolId
impl Unpin for SymbolId
impl UnsafeUnpin for SymbolId
impl UnwindSafe for SymbolId
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