Trait NodeContent

Source
pub trait NodeContent:
    Debug
    + Clone
    + PartialEq
    + Sized {
    // Provided methods
    fn into_node<T>(self) -> Node<T>
       where T: From<Self> + NodeContent { ... }
    fn spanned(self, start: LexerPosition, end: LexerPosition) -> Node<Self> { ... }
}
Expand description

Trait for AST node contents.

All nodes which will be stored in a Node need to implement this.

Provided Methods§

Source

fn into_node<T>(self) -> Node<T>
where T: From<Self> + NodeContent,

Convert the contents into a node

Source

fn spanned(self, start: LexerPosition, end: LexerPosition) -> Node<Self>

Add span information to a syntax node

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl NodeContent for &'static str

Implementors§