script::engine

Trait ScriptEngine

source
pub trait ScriptEngine {
    type Error: ErrorExt + Send + Sync;
    type Script: Script<Error = Self::Error>;

    // Required methods
    fn name(&self) -> &str;
    fn as_any(&self) -> &dyn Any;
    fn compile<'life0, 'life1, 'async_trait>(
        &'life0 self,
        script: &'life1 str,
        ctx: CompileContext,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Script, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Associated Types§

source

type Error: ErrorExt + Send + Sync

source

type Script: Script<Error = Self::Error>

Required Methods§

source

fn name(&self) -> &str

Returns the script engine name such as python etc.

source

fn as_any(&self) -> &dyn Any

source

fn compile<'life0, 'life1, 'async_trait>( &'life0 self, script: &'life1 str, ctx: CompileContext, ) -> Pin<Box<dyn Future<Output = Result<Self::Script, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Compile a script text into a script instance.

Implementors§