Skip to main content

Handler

Trait Handler 

Source
pub trait Handler<State, Sig>:
    Send
    + Sync
    + 'static
where State: Clone + Send + Sync + 'static,
{ // Required methods fn interface_decl(export_name: &str) -> DeclareFnDecl; fn inject( 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( 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> Handler<State, NativeCallableSig> for (Scheme, usize, Arc<dyn for<'a> Fn(EvaluatorRef<'a, State>, &'a Type, &'a [Pointer]) -> Result<Pointer, EngineError> + 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( self, engine: &mut Engine<State>, export_name: &str, ) -> Result<(), EngineError>

Implementors§

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<State, F, R, A, B, C, D> Handler<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) -> Result<R, EngineError> + Send + Sync + 'static, R: IntoPointer + RexType, A: FromPointer + RexType, B: FromPointer + RexType, C: FromPointer + RexType, D: FromPointer + RexType,

Source§

impl<State, F, R, A, B, C, D, E> Handler<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) -> Result<R, EngineError> + Send + Sync + 'static, R: IntoPointer + RexType, A: FromPointer + RexType, B: FromPointer + RexType, C: FromPointer + RexType, D: FromPointer + RexType, E: FromPointer + RexType,

Source§

impl<State, F, R, A, B, C, D, E, G> Handler<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) -> Result<R, EngineError> + Send + Sync + '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, R, A, B, C, D, E, G, H> Handler<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) -> Result<R, EngineError> + Send + Sync + '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, R, A, B, C, D, E, G, H, I> Handler<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) -> Result<R, EngineError> + Send + Sync + '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,