[][src]Enum rowan::NodeOrToken

pub enum NodeOrToken<N, T> {
    Node(N),
    Token(T),
}

Variants

Node(N)Token(T)

Methods

impl NodeOrToken<GreenNode, GreenToken>[src]

pub fn kind(&self) -> SyntaxKind[src]

Returns kind of this element.

pub fn text_len(&self) -> TextUnit[src]

Returns length of the text covered by this element.

impl NodeOrToken<SyntaxNode, SyntaxToken>[src]

impl<L: Language> NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>[src]

pub fn text_range(&self) -> TextRange[src]

pub fn kind(&self) -> L::Kind[src]

pub fn parent(&self) -> Option<SyntaxNode<L>>[src]

pub fn ancestors(&self) -> impl Iterator<Item = SyntaxNode<L>>[src]

pub fn next_sibling_or_token(
    &self
) -> Option<NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>>
[src]

pub fn prev_sibling_or_token(
    &self
) -> Option<NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>>
[src]

impl<N, T> NodeOrToken<N, T>[src]

pub fn into_node(self) -> Option<N>[src]

pub fn into_token(self) -> Option<T>[src]

pub fn as_node(&self) -> Option<&N>[src]

pub fn as_token(&self) -> Option<&T>[src]

Trait Implementations

impl<N: Clone, T: Clone> Clone for NodeOrToken<N, T>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<N: Ord, T: Ord> Ord for NodeOrToken<N, T>[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl From<GreenNode> for NodeOrToken<GreenNode, GreenToken>[src]

impl From<GreenToken> for NodeOrToken<GreenNode, GreenToken>[src]

impl From<SyntaxNode> for NodeOrToken<SyntaxNode, SyntaxToken>[src]

impl From<SyntaxToken> for NodeOrToken<SyntaxNode, SyntaxToken>[src]

impl<L: Language> From<NodeOrToken<SyntaxNode, SyntaxToken>> for NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>[src]

impl<L: Language> From<NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>> for NodeOrToken<SyntaxNode, SyntaxToken>[src]

impl<L: Language> From<SyntaxNode<L>> for NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>[src]

impl<L: Language> From<SyntaxToken<L>> for NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>[src]

impl<N: PartialOrd, T: PartialOrd> PartialOrd<NodeOrToken<N, T>> for NodeOrToken<N, T>[src]

impl<N: PartialEq, T: PartialEq> PartialEq<NodeOrToken<N, T>> for NodeOrToken<N, T>[src]

impl<N: Copy, T: Copy> Copy for NodeOrToken<N, T>[src]

impl<N: Eq, T: Eq> Eq for NodeOrToken<N, T>[src]

impl<N: Debug, T: Debug> Debug for NodeOrToken<N, T>[src]

impl Display for NodeOrToken<SyntaxNode, SyntaxToken>[src]

impl<L: Language> Display for NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>[src]

impl<N: Hash, T: Hash> Hash for NodeOrToken<N, T>[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl<N, T> Unpin for NodeOrToken<N, T> where
    N: Unpin,
    T: Unpin

impl<N, T> Sync for NodeOrToken<N, T> where
    N: Sync,
    T: Sync

impl<N, T> Send for NodeOrToken<N, T> where
    N: Send,
    T: Send

impl<N, T> UnwindSafe for NodeOrToken<N, T> where
    N: UnwindSafe,
    T: UnwindSafe

impl<N, T> RefUnwindSafe for NodeOrToken<N, T> where
    N: RefUnwindSafe,
    T: RefUnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]