pub struct NodeId(/* private fields */);Expand description
AST Node ID
Implementations§
Source§impl NodeId
impl NodeId
Sourcepub const CHECKS_MAX_INDEX: bool = true
pub const CHECKS_MAX_INDEX: bool = true
Whether this index type performs bounds checking.
Sourcepub fn from_foreign<F: Idx>(value: F) -> Self
pub fn from_foreign<F: Idx>(value: F) -> Self
Convert an index from another index type.
Sourcepub const unsafe fn from_usize_unchecked(value: usize) -> Self
pub const unsafe fn from_usize_unchecked(value: usize) -> Self
Create an index from a usize without bounds checking.
§SAFETY
The caller must ensure value < (u32::MAX as usize).
Sourcepub const unsafe fn from_raw_unchecked(raw: u32) -> Self
pub const unsafe fn from_raw_unchecked(raw: u32) -> Self
Create an index from a raw u32 without bounds checking.
§SAFETY
The caller must ensure the value is not u32::MAX.
Sourcepub const fn from_usize(value: usize) -> Self
pub const fn from_usize(value: usize) -> Self
Trait Implementations§
Source§impl AddAssign for NodeId
impl AddAssign for NodeId
Source§fn add_assign(&mut self, other: NodeId)
fn add_assign(&mut self, other: NodeId)
Performs the
+= operation. Read moreSource§impl AddAssign<usize> for NodeId
impl AddAssign<usize> for NodeId
Source§fn add_assign(&mut self, other: usize)
fn add_assign(&mut self, other: usize)
Performs the
+= operation. Read moreSource§impl<'alloc> CloneIn<'alloc> for NodeId
impl<'alloc> CloneIn<'alloc> for NodeId
Source§fn clone_in_impl(
&self,
with_semantic_ids: CloneInSemanticIds,
_: &'alloc Allocator,
) -> Self
fn clone_in_impl( &self, with_semantic_ids: CloneInSemanticIds, _: &'alloc Allocator, ) -> Self
Clone
self into allocator, threading whether semantic ids should be preserved as a
runtime with_semantic_ids flag rather than as two separate methods. Read moreSource§fn clone_in(&self, allocator: &'new_alloc Allocator) -> Self::Cloned
fn clone_in(&self, allocator: &'new_alloc Allocator) -> Self::Cloned
Clone
self into the given allocator. allocator may be the same one
that self is already in.Source§fn clone_in_with_semantic_ids(
&self,
allocator: &'new_alloc Allocator,
) -> Self::Cloned
fn clone_in_with_semantic_ids( &self, allocator: &'new_alloc Allocator, ) -> Self::Cloned
Almost identical as
clone_in, but for some special type, it will also clone the semantic ids.
Please use this method only if you make sure semantic info is synced with the ast node.impl Copy for NodeId
Source§impl<'de> Deserialize<'de> for NodeId
impl<'de> Deserialize<'de> for NodeId
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for NodeId
Source§impl Idx for NodeId
impl Idx for NodeId
Source§impl Ord for NodeId
impl Ord for NodeId
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 PartialOrd for NodeId
impl PartialOrd for NodeId
Source§impl PartialOrd<NodeId> for usize
impl PartialOrd<NodeId> for usize
Source§impl PartialOrd<usize> for NodeId
impl PartialOrd<usize> for NodeId
Source§impl SemanticId for NodeId
impl SemanticId for NodeId
Source§fn clone_id(&self, with_semantic_ids: CloneInSemanticIds) -> Self
fn clone_id(&self, with_semantic_ids: CloneInSemanticIds) -> Self
Clone a semantic ID. Read more
Source§fn clone_cell_option_id(
cell: &Cell<Option<Self>>,
with_semantic_ids: CloneInSemanticIds,
) -> Cell<Option<Self>>
fn clone_cell_option_id( cell: &Cell<Option<Self>>, with_semantic_ids: CloneInSemanticIds, ) -> Cell<Option<Self>>
Clone a
Cell<Option<Id>> semantic ID field. Read moreimpl StructuralPartialEq for NodeId
Auto Trait Implementations§
impl Freeze for NodeId
impl RefUnwindSafe for NodeId
impl Send for NodeId
impl Sync for NodeId
impl Unpin for NodeId
impl UnsafeUnpin for NodeId
impl UnwindSafe for NodeId
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