Skip to main content

ExternalCstNode

Trait ExternalCstNode 

Source
pub trait ExternalCstNode: Sized + Spanned {
    type Children<'syntax>: Iterator<Item = ExternalCstChild<Self>>
       where Self: 'syntax;

    // Required methods
    fn identity(&self) -> CSTNodeClassLabel<'_>;
    fn children(&self) -> Self::Children<'_>;
    fn text(&self) -> Cow<'_, str>;

    // Provided method
    fn is_extra(&self) -> bool { ... }
}
Expand description

Minimal untyped view required to reconstruct generated typed nodes.

This trait is deliberately confined to parser adapters. Its homogeneous child iterator must not be used to model or walk the typed syntax graph.

Required Associated Types§

Source

type Children<'syntax>: Iterator<Item = ExternalCstChild<Self>> where Self: 'syntax

Required Methods§

Source

fn identity(&self) -> CSTNodeClassLabel<'_>

Source

fn children(&self) -> Self::Children<'_>

Source

fn text(&self) -> Cow<'_, str>

Provided Methods§

Source

fn is_extra(&self) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl ExternalCstNode for TreeSitterNode<'_, '_>

Source§

type Children<'syntax> = IntoIter<ExternalCstChild<TreeSitterNode<'_, '_>>> where Self: 'syntax