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 declaration(export_name: &str) -> String; fn inject_async( self, engine: &mut Engine<State>, export_name: &str, ) -> Result<(), EngineError>; // Provided method fn declaration_for(&self, export_name: &str) -> String { ... } }

Required Methods§

Source

fn declaration(export_name: &str) -> String

Source

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

Provided Methods§

Source

fn declaration_for(&self, export_name: &str) -> String

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(&'a Engine<State>, Type, &'a [Pointer]) -> Pin<Box<dyn Future<Output = Result<Pointer, EngineError>> + Send + 'a>> + Sync + Send>)
where State: Clone + Send + Sync + 'static,

Source§

fn declaration(_export_name: &str) -> String

Source§

fn declaration_for(&self, export_name: &str) -> String

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,