Input

Trait Input 

pub trait Input {
    // Provided methods
    fn resolve_arg(
        &mut self,
        expr_arg: &ExprArg,
        projection: &Projection,
    ) -> Option<Expr> { ... }
    fn resolve_ref(
        &mut self,
        expr_reference: &ExprReference,
        projection: &Projection,
    ) -> Option<Expr> { ... }
}
Expand description

Provides runtime argument and reference resolution for expression evaluation and substitution.

During expression evaluation, Arg and Reference nodes are resolved by calling methods on an Input implementation. The default methods return None (unresolved).

§Examples

use toasty_core::stmt::{ConstInput, Input};

// ConstInput resolves nothing -- suitable for expressions with no
// external arguments.
let mut input = ConstInput::new();

Provided Methods§

fn resolve_arg( &mut self, expr_arg: &ExprArg, projection: &Projection, ) -> Option<Expr>

Resolves an argument expression at the given projection.

Returns Some(expr) if the argument can be resolved, or None if it cannot.

fn resolve_ref( &mut self, expr_reference: &ExprReference, projection: &Projection, ) -> Option<Expr>

Resolves a reference expression at the given projection.

Returns Some(expr) if the reference can be resolved, or None if it cannot.

Implementations on Foreign Types§

§

impl Input for &Vec<Value>

§

fn resolve_arg( &mut self, expr_arg: &ExprArg, projection: &Projection, ) -> Option<Expr>

§

impl<T> Input for &[T]
where &'a T: for<'a> Project,

§

fn resolve_arg( &mut self, expr_arg: &ExprArg, projection: &Projection, ) -> Option<Expr>

§

impl<T, const N: usize> Input for &[T; N]
where &'a T: for<'a> Project,

§

fn resolve_arg( &mut self, expr_arg: &ExprArg, projection: &Projection, ) -> Option<Expr>

§

impl<T, const N: usize> Input for [T; N]
where &'a T: for<'a> Project,

§

fn resolve_arg( &mut self, expr_arg: &ExprArg, projection: &Projection, ) -> Option<Expr>

Implementors§

§

impl Input for ConstInput

§

impl<I, T> Input for TypedInput<'_, I, T>
where I: Input, T: Resolve,