typst_syntax::ast

Trait AstNode

source
pub trait AstNode<'a>: Sized {
    // Required methods
    fn from_untyped(node: &'a SyntaxNode) -> Option<Self>;
    fn to_untyped(self) -> &'a SyntaxNode;

    // Provided method
    fn span(self) -> Span { ... }
}
Expand description

A typed AST node.

Required Methods§

source

fn from_untyped(node: &'a SyntaxNode) -> Option<Self>

Convert a node into its typed variant.

source

fn to_untyped(self) -> &'a SyntaxNode

A reference to the underlying syntax node.

Provided Methods§

source

fn span(self) -> Span

The source code location.

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.

Implementors§

source§

impl<'a> AstNode<'a> for Arg<'a>

source§

impl<'a> AstNode<'a> for ArrayItem<'a>

source§

impl<'a> AstNode<'a> for DestructuringItem<'a>

source§

impl<'a> AstNode<'a> for DictItem<'a>

source§

impl<'a> AstNode<'a> for Expr<'a>

source§

impl<'a> AstNode<'a> for Param<'a>

source§

impl<'a> AstNode<'a> for Pattern<'a>

source§

impl<'a> AstNode<'a> for Args<'a>

source§

impl<'a> AstNode<'a> for Array<'a>

source§

impl<'a> AstNode<'a> for Auto<'a>

source§

impl<'a> AstNode<'a> for Binary<'a>

source§

impl<'a> AstNode<'a> for Bool<'a>

source§

impl<'a> AstNode<'a> for Closure<'a>

source§

impl<'a> AstNode<'a> for Code<'a>

source§

impl<'a> AstNode<'a> for CodeBlock<'a>

source§

impl<'a> AstNode<'a> for Conditional<'a>

source§

impl<'a> AstNode<'a> for ContentBlock<'a>

source§

impl<'a> AstNode<'a> for Contextual<'a>

source§

impl<'a> AstNode<'a> for DestructAssignment<'a>

source§

impl<'a> AstNode<'a> for Destructuring<'a>

source§

impl<'a> AstNode<'a> for Dict<'a>

source§

impl<'a> AstNode<'a> for Emph<'a>

source§

impl<'a> AstNode<'a> for EnumItem<'a>

source§

impl<'a> AstNode<'a> for Equation<'a>

source§

impl<'a> AstNode<'a> for Escape<'a>

source§

impl<'a> AstNode<'a> for FieldAccess<'a>

source§

impl<'a> AstNode<'a> for Float<'a>

source§

impl<'a> AstNode<'a> for ForLoop<'a>

source§

impl<'a> AstNode<'a> for FuncCall<'a>

source§

impl<'a> AstNode<'a> for FuncReturn<'a>

source§

impl<'a> AstNode<'a> for Heading<'a>

source§

impl<'a> AstNode<'a> for Ident<'a>

source§

impl<'a> AstNode<'a> for ImportItemPath<'a>

source§

impl<'a> AstNode<'a> for ImportItems<'a>

source§

impl<'a> AstNode<'a> for Int<'a>

source§

impl<'a> AstNode<'a> for Keyed<'a>

source§

impl<'a> AstNode<'a> for Label<'a>

source§

impl<'a> AstNode<'a> for LetBinding<'a>

source§

impl<'a> AstNode<'a> for Linebreak<'a>

source§

impl<'a> AstNode<'a> for Link<'a>

source§

impl<'a> AstNode<'a> for ListItem<'a>

source§

impl<'a> AstNode<'a> for LoopBreak<'a>

source§

impl<'a> AstNode<'a> for LoopContinue<'a>

source§

impl<'a> AstNode<'a> for Markup<'a>

source§

impl<'a> AstNode<'a> for Math<'a>

source§

impl<'a> AstNode<'a> for MathAlignPoint<'a>

source§

impl<'a> AstNode<'a> for MathAttach<'a>

source§

impl<'a> AstNode<'a> for MathDelimited<'a>

source§

impl<'a> AstNode<'a> for MathFrac<'a>

source§

impl<'a> AstNode<'a> for MathIdent<'a>

source§

impl<'a> AstNode<'a> for MathPrimes<'a>

source§

impl<'a> AstNode<'a> for MathRoot<'a>

source§

impl<'a> AstNode<'a> for MathShorthand<'a>

source§

impl<'a> AstNode<'a> for ModuleImport<'a>

source§

impl<'a> AstNode<'a> for ModuleInclude<'a>

source§

impl<'a> AstNode<'a> for Named<'a>

source§

impl<'a> AstNode<'a> for None<'a>

source§

impl<'a> AstNode<'a> for Numeric<'a>

source§

impl<'a> AstNode<'a> for Params<'a>

source§

impl<'a> AstNode<'a> for Parbreak<'a>

source§

impl<'a> AstNode<'a> for Parenthesized<'a>

source§

impl<'a> AstNode<'a> for Raw<'a>

source§

impl<'a> AstNode<'a> for RawDelim<'a>

source§

impl<'a> AstNode<'a> for RawLang<'a>

source§

impl<'a> AstNode<'a> for Ref<'a>

source§

impl<'a> AstNode<'a> for RenamedImportItem<'a>

source§

impl<'a> AstNode<'a> for SetRule<'a>

source§

impl<'a> AstNode<'a> for Shorthand<'a>

source§

impl<'a> AstNode<'a> for ShowRule<'a>

source§

impl<'a> AstNode<'a> for SmartQuote<'a>

source§

impl<'a> AstNode<'a> for Space<'a>

source§

impl<'a> AstNode<'a> for Spread<'a>

source§

impl<'a> AstNode<'a> for Str<'a>

source§

impl<'a> AstNode<'a> for Strong<'a>

source§

impl<'a> AstNode<'a> for TermItem<'a>

source§

impl<'a> AstNode<'a> for Text<'a>

source§

impl<'a> AstNode<'a> for Unary<'a>

source§

impl<'a> AstNode<'a> for Underscore<'a>

source§

impl<'a> AstNode<'a> for WhileLoop<'a>