Skip to main content

Context

Trait Context 

Source
pub trait Context: Send + Sync {
    // Required method
    fn get_var<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Value>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

The context of the filter for evaluation.

Required Methods§

Source

fn get_var<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Value>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the value of a variable/field.

It is a async function so that the callee can even request the database or network to get the value.

If the variable is not found, return None.

If some error occurs, return the error.

Implementors§