Skip to main content

ErasedTool

Trait ErasedTool 

Source
pub trait ErasedTool:
    Send
    + Sync
    + 'static {
    // Required methods
    fn name(&self) -> &'static str;
    fn description(&self) -> &'static str;
    fn schema(&self) -> Schema;
    fn erased_is_available<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        ctx_request: &'life1 ContextRequest,
        compiled_context: &'life2 Value,
    ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn erased_execute<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ctx_request: &'life1 ContextRequest,
        args: Value,
    ) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

Source

fn name(&self) -> &'static str

Source

fn description(&self) -> &'static str

Source

fn schema(&self) -> Schema

Source

fn erased_is_available<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx_request: &'life1 ContextRequest, compiled_context: &'life2 Value, ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn erased_execute<'life0, 'life1, 'async_trait>( &'life0 self, ctx_request: &'life1 ContextRequest, args: Value, ) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> ErasedTool for T
where T: Tool,