Enum oq3_syntax::NodeOrToken
source · pub enum NodeOrToken<N, T> {
Node(N),
Token(T),
}
Variants§
Implementations§
source§impl NodeOrToken<&GreenNodeData, &GreenTokenData>
impl NodeOrToken<&GreenNodeData, &GreenTokenData>
pub fn to_owned(self) -> NodeOrToken<GreenNode, GreenToken>
source§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)
source§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§
source§impl<N, T> Clone for NodeOrToken<N, T>
impl<N, T> Clone for NodeOrToken<N, T>
source§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 moresource§impl<N, T> Debug for NodeOrToken<N, T>
impl<N, T> Debug for NodeOrToken<N, T>
source§impl<N, T> Display for NodeOrToken<N, T>
impl<N, T> Display for NodeOrToken<N, T>
source§impl<'a> From<&'a GreenNode> for NodeOrToken<&'a GreenNodeData, &'a GreenTokenData>
impl<'a> From<&'a GreenNode> for NodeOrToken<&'a GreenNodeData, &'a GreenTokenData>
source§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.
source§impl<'a> From<&'a GreenToken> for NodeOrToken<&'a GreenNodeData, &'a GreenTokenData>
impl<'a> From<&'a GreenToken> for NodeOrToken<&'a GreenNodeData, &'a GreenTokenData>
source§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.
source§impl From<Cow<'_, GreenNodeData>> for NodeOrToken<GreenNode, GreenToken>
impl From<Cow<'_, GreenNodeData>> for NodeOrToken<GreenNode, GreenToken>
source§fn from(cow: Cow<'_, GreenNodeData>) -> NodeOrToken<GreenNode, GreenToken>
fn from(cow: Cow<'_, GreenNodeData>) -> NodeOrToken<GreenNode, GreenToken>
Converts to this type from the input type.
source§impl From<GreenNode> for NodeOrToken<GreenNode, GreenToken>
impl From<GreenNode> for NodeOrToken<GreenNode, GreenToken>
source§fn from(node: GreenNode) -> NodeOrToken<GreenNode, GreenToken>
fn from(node: GreenNode) -> NodeOrToken<GreenNode, GreenToken>
Converts to this type from the input type.
source§impl From<GreenToken> for NodeOrToken<GreenNode, GreenToken>
impl From<GreenToken> for NodeOrToken<GreenNode, GreenToken>
source§fn from(token: GreenToken) -> NodeOrToken<GreenNode, GreenToken>
fn from(token: GreenToken) -> NodeOrToken<GreenNode, GreenToken>
Converts to this type from the input type.
source§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,
source§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.
source§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,
source§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.
source§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,
source§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.
source§impl From<SyntaxNode> for NodeOrToken<SyntaxNode, SyntaxToken>
impl From<SyntaxNode> for NodeOrToken<SyntaxNode, SyntaxToken>
source§fn from(node: SyntaxNode) -> NodeOrToken<SyntaxNode, SyntaxToken>
fn from(node: SyntaxNode) -> NodeOrToken<SyntaxNode, SyntaxToken>
Converts to this type from the input type.
source§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,
source§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.
source§impl From<SyntaxToken> for NodeOrToken<SyntaxNode, SyntaxToken>
impl From<SyntaxToken> for NodeOrToken<SyntaxNode, SyntaxToken>
source§fn from(token: SyntaxToken) -> NodeOrToken<SyntaxNode, SyntaxToken>
fn from(token: SyntaxToken) -> NodeOrToken<SyntaxNode, SyntaxToken>
Converts to this type from the input type.
source§impl<N, T> Hash for NodeOrToken<N, T>
impl<N, T> Hash for NodeOrToken<N, T>
source§impl<N, T> Ord for NodeOrToken<N, T>
impl<N, T> Ord for NodeOrToken<N, T>
source§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
source§impl<N, T> PartialEq for NodeOrToken<N, T>
impl<N, T> PartialEq for NodeOrToken<N, T>
source§fn eq(&self, other: &NodeOrToken<N, T>) -> bool
fn eq(&self, other: &NodeOrToken<N, T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§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,
source§fn partial_cmp(&self, other: &NodeOrToken<N, T>) -> Option<Ordering>
fn partial_cmp(&self, other: &NodeOrToken<N, T>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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