Enum NodeOrToken
pub enum NodeOrToken<N, T> {
Node(N),
Token(T),
}
Variants§
Implementations§
§impl NodeOrToken<&GreenNodeData, &GreenTokenData>
impl NodeOrToken<&GreenNodeData, &GreenTokenData>
pub fn to_owned(self) -> NodeOrToken<GreenNode, GreenToken>
§impl NodeOrToken<GreenNode, GreenToken>
impl NodeOrToken<GreenNode, GreenToken>
§impl NodeOrToken<&GreenNodeData, &GreenTokenData>
impl NodeOrToken<&GreenNodeData, &GreenTokenData>
§impl NodeOrToken<SyntaxNode, SyntaxToken>
impl NodeOrToken<SyntaxNode, SyntaxToken>
pub fn text_range(&self) -> TextRange
pub fn index(&self) -> usize
pub fn kind(&self) -> SyntaxKind
pub fn parent(&self) -> Option<SyntaxNode>
pub fn ancestors(&self) -> impl Iterator<Item = SyntaxNode>
pub fn first_token(&self) -> Option<SyntaxToken>
pub fn last_token(&self) -> Option<SyntaxToken>
pub fn next_sibling_or_token( &self, ) -> Option<NodeOrToken<SyntaxNode, SyntaxToken>>
pub fn prev_sibling_or_token( &self, ) -> Option<NodeOrToken<SyntaxNode, SyntaxToken>>
pub fn detach(&self)
§impl<L> NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>where
L: Language,
impl<L> NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>where
L: Language,
pub fn text_range(&self) -> TextRange
pub fn index(&self) -> usize
pub fn kind(&self) -> <L as Language>::Kind
pub fn parent(&self) -> Option<SyntaxNode<L>>
pub fn ancestors(&self) -> impl Iterator<Item = SyntaxNode<L>>
pub fn next_sibling_or_token( &self, ) -> Option<NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>>
pub fn prev_sibling_or_token( &self, ) -> Option<NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>>
pub fn detach(&self)
Trait Implementations§
§impl<N, T> Clone for NodeOrToken<N, T>
impl<N, T> Clone for NodeOrToken<N, T>
§fn clone(&self) -> NodeOrToken<N, T>
fn clone(&self) -> NodeOrToken<N, T>
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 more§impl<N, T> Debug for NodeOrToken<N, T>
impl<N, T> Debug for NodeOrToken<N, T>
§impl<N, T> Display for NodeOrToken<N, T>
impl<N, T> Display for NodeOrToken<N, T>
§impl<'a> From<&'a GreenNode> for NodeOrToken<&'a GreenNodeData, &'a GreenTokenData>
impl<'a> From<&'a GreenNode> for NodeOrToken<&'a GreenNodeData, &'a GreenTokenData>
§fn from(
node: &'a GreenNode,
) -> NodeOrToken<&'a GreenNodeData, &'a GreenTokenData>
fn from( node: &'a GreenNode, ) -> NodeOrToken<&'a GreenNodeData, &'a GreenTokenData>
Converts to this type from the input type.
§impl<'a> From<&'a GreenToken> for NodeOrToken<&'a GreenNodeData, &'a GreenTokenData>
impl<'a> From<&'a GreenToken> for NodeOrToken<&'a GreenNodeData, &'a GreenTokenData>
§fn from(
token: &'a GreenToken,
) -> NodeOrToken<&'a GreenNodeData, &'a GreenTokenData>
fn from( token: &'a GreenToken, ) -> NodeOrToken<&'a GreenNodeData, &'a GreenTokenData>
Converts to this type from the input type.
§impl From<Cow<'_, GreenNodeData>> for NodeOrToken<GreenNode, GreenToken>
impl From<Cow<'_, GreenNodeData>> for NodeOrToken<GreenNode, GreenToken>
§fn from(cow: Cow<'_, GreenNodeData>) -> NodeOrToken<GreenNode, GreenToken>
fn from(cow: Cow<'_, GreenNodeData>) -> NodeOrToken<GreenNode, GreenToken>
Converts to this type from the input type.
§impl From<GreenNode> for NodeOrToken<GreenNode, GreenToken>
impl From<GreenNode> for NodeOrToken<GreenNode, GreenToken>
§fn from(node: GreenNode) -> NodeOrToken<GreenNode, GreenToken>
fn from(node: GreenNode) -> NodeOrToken<GreenNode, GreenToken>
Converts to this type from the input type.
§impl From<GreenToken> for NodeOrToken<GreenNode, GreenToken>
impl From<GreenToken> for NodeOrToken<GreenNode, GreenToken>
§fn from(token: GreenToken) -> NodeOrToken<GreenNode, GreenToken>
fn from(token: GreenToken) -> NodeOrToken<GreenNode, GreenToken>
Converts to this type from the input type.
§impl<L> From<NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>> for NodeOrToken<SyntaxNode, SyntaxToken>where
L: Language,
impl<L> From<NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>> for NodeOrToken<SyntaxNode, SyntaxToken>where
L: Language,
§fn from(
element: NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>,
) -> NodeOrToken<SyntaxNode, SyntaxToken>
fn from( element: NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>, ) -> NodeOrToken<SyntaxNode, SyntaxToken>
Converts to this type from the input type.
§impl<L> From<NodeOrToken<SyntaxNode, SyntaxToken>> for NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>where
L: Language,
impl<L> From<NodeOrToken<SyntaxNode, SyntaxToken>> for NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>where
L: Language,
§fn from(
raw: NodeOrToken<SyntaxNode, SyntaxToken>,
) -> NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>
fn from( raw: NodeOrToken<SyntaxNode, SyntaxToken>, ) -> NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>
Converts to this type from the input type.
§impl<L> From<SyntaxNode<L>> for NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>where
L: Language,
impl<L> From<SyntaxNode<L>> for NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>where
L: Language,
§fn from(node: SyntaxNode<L>) -> NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>
fn from(node: SyntaxNode<L>) -> NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>
Converts to this type from the input type.
§impl From<SyntaxNode> for NodeOrToken<SyntaxNode, SyntaxToken>
impl From<SyntaxNode> for NodeOrToken<SyntaxNode, SyntaxToken>
§fn from(node: SyntaxNode) -> NodeOrToken<SyntaxNode, SyntaxToken>
fn from(node: SyntaxNode) -> NodeOrToken<SyntaxNode, SyntaxToken>
Converts to this type from the input type.
§impl<L> From<SyntaxToken<L>> for NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>where
L: Language,
impl<L> From<SyntaxToken<L>> for NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>where
L: Language,
§fn from(token: SyntaxToken<L>) -> NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>
fn from(token: SyntaxToken<L>) -> NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>
Converts to this type from the input type.
§impl From<SyntaxToken> for NodeOrToken<SyntaxNode, SyntaxToken>
impl From<SyntaxToken> for NodeOrToken<SyntaxNode, SyntaxToken>
§fn from(token: SyntaxToken) -> NodeOrToken<SyntaxNode, SyntaxToken>
fn from(token: SyntaxToken) -> NodeOrToken<SyntaxNode, SyntaxToken>
Converts to this type from the input type.
§impl<N, T> Hash for NodeOrToken<N, T>
impl<N, T> Hash for NodeOrToken<N, T>
§impl<N, T> Ord for NodeOrToken<N, T>
impl<N, T> Ord for NodeOrToken<N, T>
§fn cmp(&self, other: &NodeOrToken<N, T>) -> Ordering
fn cmp(&self, other: &NodeOrToken<N, T>) -> Ordering
1.21.0 · 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
§impl<N, T> PartialEq for NodeOrToken<N, T>
impl<N, T> PartialEq for NodeOrToken<N, T>
§impl<N, T> PartialOrd for NodeOrToken<N, T>where
N: PartialOrd,
T: PartialOrd,
impl<N, T> PartialOrd for NodeOrToken<N, T>where
N: PartialOrd,
T: PartialOrd,
impl<N, T> Copy for NodeOrToken<N, T>
impl<N, T> Eq for NodeOrToken<N, T>
impl<N, T> StructuralPartialEq for NodeOrToken<N, T>
Auto Trait Implementations§
impl<N, T> Freeze for NodeOrToken<N, T>
impl<N, T> RefUnwindSafe for NodeOrToken<N, T>where
N: RefUnwindSafe,
T: RefUnwindSafe,
impl<N, T> Send for NodeOrToken<N, T>
impl<N, T> Sync for NodeOrToken<N, T>
impl<N, T> Unpin for NodeOrToken<N, T>
impl<N, T> UnwindSafe for NodeOrToken<N, T>where
N: UnwindSafe,
T: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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