Enum rowan::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<&'_ GreenNodeData, &'_ GreenTokenData>
impl NodeOrToken<&'_ GreenNodeData, &'_ GreenTokenData>
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<SyntaxElement>
pub fn prev_sibling_or_token(&self) -> Option<SyntaxElement>
pub fn detach(&self)
source§impl<L: Language> NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>
impl<L: Language> NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>
pub fn text_range(&self) -> TextRange
pub fn index(&self) -> usize
pub fn kind(&self) -> L::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<SyntaxElement<L>>
pub fn prev_sibling_or_token(&self) -> Option<SyntaxElement<L>>
pub fn detach(&self)
Trait Implementations§
source§impl<N: Clone, T: Clone> Clone for NodeOrToken<N, T>
impl<N: Clone, T: Clone> 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<'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>) -> Self
fn from(cow: Cow<'_, GreenNodeData>) -> Self
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: Language> From<NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>> for SyntaxElement
impl<L: Language> From<NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>> for SyntaxElement
source§fn from(element: SyntaxElement<L>) -> SyntaxElement
fn from(element: SyntaxElement<L>) -> SyntaxElement
Converts to this type from the input type.
source§impl<L: Language> From<NodeOrToken<SyntaxNode, SyntaxToken>> for SyntaxElement<L>
impl<L: Language> From<NodeOrToken<SyntaxNode, SyntaxToken>> for SyntaxElement<L>
source§fn from(raw: SyntaxElement) -> SyntaxElement<L>
fn from(raw: SyntaxElement) -> SyntaxElement<L>
Converts to this type from the input type.
source§impl<N: Ord, T: Ord> Ord for NodeOrToken<N, T>
impl<N: Ord, T: Ord> 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: PartialEq, T: PartialEq> PartialEq for NodeOrToken<N, T>
impl<N: PartialEq, T: PartialEq> 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: PartialOrd, T: PartialOrd> PartialOrd for NodeOrToken<N, T>
impl<N: PartialOrd, T: PartialOrd> PartialOrd for NodeOrToken<N, T>
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: Copy, T: Copy> Copy for NodeOrToken<N, T>
impl<N: Eq, T: Eq> 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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
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
)