DynamicFunction

Trait DynamicFunction 

Source
pub trait DynamicFunction: Send + Sync {
    // Required methods
    fn schema(&self, diags: &mut Diagnostics) -> Option<FunctionSchema>;
    fn call<'a, 'life0, 'life1, 'async_trait>(
        &'life0 self,
        diags: &'life1 mut Diagnostics,
        params: Vec<RawValue>,
    ) -> Pin<Box<dyn Future<Output = Option<RawValue>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait for implementing a function without automatic serialization/deserialization

See also: Function

Required Methods§

Source

fn schema(&self, diags: &mut Diagnostics) -> Option<FunctionSchema>

Get the schema of the function

§Arguments
  • diags - Diagnostics to record warnings and errors that occured when getting back the schema
§Remarks

The return is ignored if there is an error in diagnostics. If the return is None, an ad-hoc error is added to diagnostics.

Source

fn call<'a, 'life0, 'life1, 'async_trait>( &'life0 self, diags: &'life1 mut Diagnostics, params: Vec<RawValue>, ) -> Pin<Box<dyn Future<Output = Option<RawValue>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Call Function

§Arguments
  • diags - Diagnostics to record warnings and errors that occured when calling the function
  • params - Function parameters
§Remarks

The return is ignored if there is an error in diagnostics. If the return is None, an ad-hoc error is added to diagnostics.

Trait Implementations§

Source§

impl<T: Function + 'static> From<T> for Box<dyn DynamicFunction>

Source§

fn from(value: T) -> Self

Converts to this type from the input type.

Implementors§