Skip to main content

AsyncHandler

Trait AsyncHandler 

Source
pub trait AsyncHandler<State, Sig>:
    Send
    + Sync
    + 'static
where State: Clone + Send + Sync + 'static,
{ // Required methods fn interface_decl(export_name: &str) -> DeclareFnDecl; fn inject_async( self, engine: &mut Engine<State>, export_name: &str, ) -> Result<(), EngineError>; // Provided method fn interface_decl_for(&self, export_name: &str) -> DeclareFnDecl { ... } }

Required Methods§

Source

fn interface_decl(export_name: &str) -> DeclareFnDecl

Source

fn inject_async( self, engine: &mut Engine<State>, export_name: &str, ) -> Result<(), EngineError>

Provided Methods§

Source

fn interface_decl_for(&self, export_name: &str) -> DeclareFnDecl

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<State> AsyncHandler<State, AsyncNativeCallableSig> for (Scheme, usize, Arc<dyn for<'a> Fn(EvaluatorRef<'a, State>, Type, &'a [Pointer]) -> Pin<Box<dyn Future<Output = Result<Pointer, EngineError>> + Send + 'a>> + Sync + Send>)
where State: Clone + Send + Sync + 'static,

Source§

fn interface_decl(_export_name: &str) -> DeclareFnDecl

Source§

fn interface_decl_for(&self, export_name: &str) -> DeclareFnDecl

Source§

fn inject_async( self, engine: &mut Engine<State>, export_name: &str, ) -> Result<(), EngineError>

Implementors§

Source§

impl<State, F, Fut, R> AsyncHandler<State, fn() -> R> for F
where State: Clone + Send + Sync + 'static, F: for<'a> Fn(&'a State) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<R, EngineError>> + Send + 'static, R: IntoPointer + RexType,

Source§

impl<State, F, Fut, R, A> AsyncHandler<State, fn(A) -> R> for F
where State: Clone + Send + Sync + 'static, F: for<'a> Fn(&'a State, A) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<R, EngineError>> + Send + 'static, R: IntoPointer + RexType, A: FromPointer + RexType,

Source§

impl<State, F, Fut, R, A, B> AsyncHandler<State, fn(A, B) -> R> for F
where State: Clone + Send + Sync + 'static, F: for<'a> Fn(&'a State, A, B) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<R, EngineError>> + Send + 'static, R: IntoPointer + RexType, A: FromPointer + RexType, B: FromPointer + RexType,

Source§

impl<State, F, Fut, R, A, B, C> AsyncHandler<State, fn(A, B, C) -> R> for F
where State: Clone + Send + Sync + 'static, F: for<'a> Fn(&'a State, A, B, C) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<R, EngineError>> + Send + 'static, R: IntoPointer + RexType, A: FromPointer + RexType, B: FromPointer + RexType, C: FromPointer + RexType,

Source§

impl<State, F, Fut, R, A, B, C, D> AsyncHandler<State, fn(A, B, C, D) -> R> for F
where State: Clone + Send + Sync + 'static, F: for<'a> Fn(&'a State, A, B, C, D) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<R, EngineError>> + Send + 'static, R: IntoPointer + RexType, A: FromPointer + RexType, B: FromPointer + RexType, C: FromPointer + RexType, D: FromPointer + RexType,

Source§

impl<State, F, Fut, R, A, B, C, D, E> AsyncHandler<State, fn(A, B, C, D, E) -> R> for F
where State: Clone + Send + Sync + 'static, F: for<'a> Fn(&'a State, A, B, C, D, E) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<R, EngineError>> + Send + 'static, R: IntoPointer + RexType, A: FromPointer + RexType, B: FromPointer + RexType, C: FromPointer + RexType, D: FromPointer + RexType, E: FromPointer + RexType,

Source§

impl<State, F, Fut, R, A, B, C, D, E, G> AsyncHandler<State, fn(A, B, C, D, E, G) -> R> for F
where State: Clone + Send + Sync + 'static, F: for<'a> Fn(&'a State, A, B, C, D, E, G) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<R, EngineError>> + Send + 'static, R: IntoPointer + RexType, A: FromPointer + RexType, B: FromPointer + RexType, C: FromPointer + RexType, D: FromPointer + RexType, E: FromPointer + RexType, G: FromPointer + RexType,

Source§

impl<State, F, Fut, R, A, B, C, D, E, G, H> AsyncHandler<State, fn(A, B, C, D, E, G, H) -> R> for F
where State: Clone + Send + Sync + 'static, F: for<'a> Fn(&'a State, A, B, C, D, E, G, H) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<R, EngineError>> + Send + 'static, R: IntoPointer + RexType, A: FromPointer + RexType, B: FromPointer + RexType, C: FromPointer + RexType, D: FromPointer + RexType, E: FromPointer + RexType, G: FromPointer + RexType, H: FromPointer + RexType,

Source§

impl<State, F, Fut, R, A, B, C, D, E, G, H, I> AsyncHandler<State, fn(A, B, C, D, E, G, H, I) -> R> for F
where State: Clone + Send + Sync + 'static, F: for<'a> Fn(&'a State, A, B, C, D, E, G, H, I) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<R, EngineError>> + Send + 'static, R: IntoPointer + RexType, A: FromPointer + RexType, B: FromPointer + RexType, C: FromPointer + RexType, D: FromPointer + RexType, E: FromPointer + RexType, G: FromPointer + RexType, H: FromPointer + RexType, I: FromPointer + RexType,