Input

Trait Input 

Source
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§

Source

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.

Source

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§

Source§

impl Input for &Vec<Value>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§

Source§

impl Input for ConstInput

Source§

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