Struct cairo_lang_syntax::node::ids::SyntaxStablePtrId
source · pub struct SyntaxStablePtrId(/* private fields */);
Implementations§
source§impl SyntaxStablePtrId
impl SyntaxStablePtrId
sourcepub fn lookup(&self, db: &dyn SyntaxGroup) -> SyntaxNode
pub fn lookup(&self, db: &dyn SyntaxGroup) -> SyntaxNode
Lookups a syntax node using a stable syntax pointer. Should only be called on the root from which the stable pointer was generated.
pub fn file_id(&self, db: &dyn SyntaxGroup) -> FileId
sourcepub fn parent(&self, db: &dyn SyntaxGroup) -> SyntaxStablePtrId
pub fn parent(&self, db: &dyn SyntaxGroup) -> SyntaxStablePtrId
Returns the stable pointer of the parent of this stable pointer.
sourcepub fn nth_parent(&self, db: &dyn SyntaxGroup, n: usize) -> SyntaxStablePtrId
pub fn nth_parent(&self, db: &dyn SyntaxGroup, n: usize) -> SyntaxStablePtrId
Returns the stable pointer of the n
th parent of this stable pointer.
n = 0: returns itself.
n = 1: return the parent.
n = 2: return the grand parent.
And so on…
Trait Implementations§
source§impl Clone for SyntaxStablePtrId
impl Clone for SyntaxStablePtrId
source§fn clone(&self) -> SyntaxStablePtrId
fn clone(&self) -> SyntaxStablePtrId
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SyntaxStablePtrId
impl Debug for SyntaxStablePtrId
source§impl<T: ?Sized + Upcast<dyn SyntaxGroup + 'static>> DebugWithDb<T> for SyntaxStablePtrId
impl<T: ?Sized + Upcast<dyn SyntaxGroup + 'static>> DebugWithDb<T> for SyntaxStablePtrId
source§impl Hash for SyntaxStablePtrId
impl Hash for SyntaxStablePtrId
source§impl InternKey for SyntaxStablePtrId
impl InternKey for SyntaxStablePtrId
source§fn from_intern_id(salsa_id: InternId) -> Self
fn from_intern_id(salsa_id: InternId) -> Self
Create an instance of the intern-key from a
u32
value.source§fn as_intern_id(&self) -> InternId
fn as_intern_id(&self) -> InternId
Extract the
u32
with which the intern-key was created.source§impl PartialEq for SyntaxStablePtrId
impl PartialEq for SyntaxStablePtrId
source§fn eq(&self, other: &SyntaxStablePtrId) -> bool
fn eq(&self, other: &SyntaxStablePtrId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for SyntaxStablePtrId
impl Eq for SyntaxStablePtrId
impl StructuralPartialEq for SyntaxStablePtrId
Auto Trait Implementations§
impl RefUnwindSafe for SyntaxStablePtrId
impl Send for SyntaxStablePtrId
impl Sync for SyntaxStablePtrId
impl Unpin for SyntaxStablePtrId
impl UnwindSafe for SyntaxStablePtrId
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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.