[][src]Trait rnix::types::TypedNode

pub trait TypedNode: Clone {
    fn cast(from: SyntaxNode) -> Option<Self>;
fn node(&self) -> &SyntaxNode; fn errors(&self) -> Vec<SyntaxElement> { ... }
fn first_token(&self) -> Option<SyntaxToken> { ... }
fn dump(&self) -> TextDump { ... } }

A TypedNode is simply a wrapper around an untyped node to provide a type system in some sense.

Required methods

fn cast(from: SyntaxNode) -> Option<Self>

Cast an untyped node into this strongly-typed node. This will return None if the type was not correct.

fn node(&self) -> &SyntaxNode

Return a reference to the inner untyped node

Loading content...

Provided methods

fn errors(&self) -> Vec<SyntaxElement>

Return all errors of all children, recursively

fn first_token(&self) -> Option<SyntaxToken>

Return the first non-trivia token

fn dump(&self) -> TextDump

Return a dump of the AST. One of the goals is to be a stable format that can be used in tests.

Loading content...

Implementors

impl TypedNode for Apply[src]

impl TypedNode for Assert[src]

impl TypedNode for AttrSet[src]

impl TypedNode for BinOp[src]

impl TypedNode for Dynamic[src]

impl TypedNode for Error[src]

impl TypedNode for Ident[src]

impl TypedNode for IfElse[src]

impl TypedNode for Inherit[src]

impl TypedNode for InheritFrom[src]

impl TypedNode for Key[src]

impl TypedNode for KeyValue[src]

impl TypedNode for Lambda[src]

impl TypedNode for LegacyLet[src]

impl TypedNode for LetIn[src]

impl TypedNode for List[src]

impl TypedNode for OrDefault[src]

impl TypedNode for Paren[src]

impl TypedNode for PatBind[src]

impl TypedNode for PatEntry[src]

impl TypedNode for Pattern[src]

impl TypedNode for Root[src]

impl TypedNode for Select[src]

impl TypedNode for Str[src]

impl TypedNode for UnaryOp[src]

impl TypedNode for Value[src]

impl TypedNode for With[src]

Loading content...