RustQ.Rust.AST.Builder (rustq v0.6.0)

Copy Markdown View Source

Small builder DSL for RustQ.Rust.AST nodes.

Use functions for leaves and do-block macros for tree-shaped constructs like blocks, matches, arms, and returns.

Summary

Functions

Functions

add(left, right)

allow_attr(value)

and_(left, right)

arg(name, type)

arm(pattern, list)

(macro)

array(values)

assign(target, expression)

atom(name, opts \\ [])

attr(path, args \\ [])

attr_value(path, value)

badarg()

badarg_arm()

binary(left, op, right)

block(list)

(macro)

byte_string(value)

call(name, args \\ [])

cast(expression, type)

closure(args, body)

const(name, type, expression, opts \\ [])

deref(expression)

derive(paths)

div(left, right)

early_return(expression)

eq(left, right)

err(expression)

escape_expr(source)

expr(value)

expr_path(path)

field(receiver, field)

flatten(values)

for_(pattern, expression, body)

function_arg(arg)

function_arg(name, type)

function_args(args)

gt(left, right)

gte(left, right)

if_expr(condition, list)

(macro)

if_expr(condition, then_body, else_body)

if_let(pattern, expression, then_body, opts \\ [])

impl(target, opts \\ [])

index(receiver, index)

let(name, expression, opts \\ [])

let_else(pattern, expression, else_body)

let_mut(name, expression, opts \\ [])

lit(value)

lt(left, right)

lte(left, right)

macro_call(path, args \\ [])

macro_item(source)

macro_item_call(path, args \\ [])

match(expr, list)

(macro)

match_expr(expression, arms)

method(receiver, method, args \\ [], opts \\ [])

module(name, items, opts \\ [])

mul(left, right)

mut_ref(expression)

ne(left, right)

neg(expression)

nif_attr(opts \\ [])

none()

not_(expression)

ok()

ok(expression)

or_(left, right)

pat(name)

pat_expr(value)

path(parts)

path(first, second)

path(first, second, third)

path_call(parts, args \\ [], opts \\ [])

path_parts(parts)

path_value(parts)

range(start, stop)

receiver(opts \\ [])

ref(expression)

resource_impl_attr()

return(expression)

(macro)

return_badarg()

return_stmt(expression)

slice(values)

some(expression)

static(name, type, expression, opts \\ [])

stmt(expression)

struct(path, fields)

sub(left, right)

token_macro(path, tokens)

trait_path(path)

try(expression)

tuple(values)

type(value)

type_alias(name, type, opts \\ [])

type_path(parts_or_part, opts \\ [])

use(parts)

var(name)

vec(values)

wildcard()