WasmClosure

Trait WasmClosure 

Source
pub trait WasmClosure<M> {
    // Required method
    fn into_js_closure(boxed: Box<Self>) -> Closure<Self>;
}
Expand description

Trait for closure types that can be wrapped and passed to JavaScript. This trait is implemented for all dyn FnMut(...) variants.

Required Methods§

Source

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Create a Closure from a boxed closure.

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<R> WasmClosure<fn() -> R> for dyn Fn() -> R
where R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R> WasmClosure<fn() -> R> for dyn FnMut() -> R
where R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1> WasmClosure<(BorrowedFirstArg, fn(&A1) -> R)> for dyn Fn(&A1) -> R
where A1: RefFromBinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1> WasmClosure<(BorrowedFirstArg, fn(&A1) -> R)> for dyn FnMut(&A1) -> R
where A1: RefFromBinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1> WasmClosure<fn(A1) -> R> for dyn Fn(A1) -> R
where A1: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1> WasmClosure<fn(A1) -> R> for dyn FnMut(A1) -> R
where A1: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2> WasmClosure<(BorrowedFirstArg, fn(&A1, A2) -> R)> for dyn Fn(&A1, A2) -> R
where A1: RefFromBinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2> WasmClosure<(BorrowedFirstArg, fn(&A1, A2) -> R)> for dyn FnMut(&A1, A2) -> R
where A1: RefFromBinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2> WasmClosure<fn(A1, A2) -> R> for dyn Fn(A1, A2) -> R
where A1: BinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2> WasmClosure<fn(A1, A2) -> R> for dyn FnMut(A1, A2) -> R
where A1: BinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2, A3> WasmClosure<(BorrowedFirstArg, fn(&A1, A2, A3) -> R)> for dyn Fn(&A1, A2, A3) -> R
where A1: RefFromBinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, A3: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2, A3> WasmClosure<(BorrowedFirstArg, fn(&A1, A2, A3) -> R)> for dyn FnMut(&A1, A2, A3) -> R
where A1: RefFromBinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, A3: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2, A3> WasmClosure<fn(A1, A2, A3) -> R> for dyn Fn(A1, A2, A3) -> R
where A1: BinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, A3: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2, A3> WasmClosure<fn(A1, A2, A3) -> R> for dyn FnMut(A1, A2, A3) -> R
where A1: BinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, A3: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2, A3, A4> WasmClosure<(BorrowedFirstArg, fn(&A1, A2, A3, A4) -> R)> for dyn Fn(&A1, A2, A3, A4) -> R
where A1: RefFromBinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, A3: BinaryDecode + EncodeTypeDef + 'static, A4: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2, A3, A4> WasmClosure<(BorrowedFirstArg, fn(&A1, A2, A3, A4) -> R)> for dyn FnMut(&A1, A2, A3, A4) -> R
where A1: RefFromBinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, A3: BinaryDecode + EncodeTypeDef + 'static, A4: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2, A3, A4> WasmClosure<fn(A1, A2, A3, A4) -> R> for dyn Fn(A1, A2, A3, A4) -> R
where A1: BinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, A3: BinaryDecode + EncodeTypeDef + 'static, A4: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2, A3, A4> WasmClosure<fn(A1, A2, A3, A4) -> R> for dyn FnMut(A1, A2, A3, A4) -> R
where A1: BinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, A3: BinaryDecode + EncodeTypeDef + 'static, A4: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2, A3, A4, A5> WasmClosure<(BorrowedFirstArg, fn(&A1, A2, A3, A4, A5) -> R)> for dyn Fn(&A1, A2, A3, A4, A5) -> R
where A1: RefFromBinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, A3: BinaryDecode + EncodeTypeDef + 'static, A4: BinaryDecode + EncodeTypeDef + 'static, A5: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2, A3, A4, A5> WasmClosure<(BorrowedFirstArg, fn(&A1, A2, A3, A4, A5) -> R)> for dyn FnMut(&A1, A2, A3, A4, A5) -> R
where A1: RefFromBinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, A3: BinaryDecode + EncodeTypeDef + 'static, A4: BinaryDecode + EncodeTypeDef + 'static, A5: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2, A3, A4, A5> WasmClosure<fn(A1, A2, A3, A4, A5) -> R> for dyn Fn(A1, A2, A3, A4, A5) -> R
where A1: BinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, A3: BinaryDecode + EncodeTypeDef + 'static, A4: BinaryDecode + EncodeTypeDef + 'static, A5: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2, A3, A4, A5> WasmClosure<fn(A1, A2, A3, A4, A5) -> R> for dyn FnMut(A1, A2, A3, A4, A5) -> R
where A1: BinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, A3: BinaryDecode + EncodeTypeDef + 'static, A4: BinaryDecode + EncodeTypeDef + 'static, A5: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2, A3, A4, A5, A6> WasmClosure<(BorrowedFirstArg, fn(&A1, A2, A3, A4, A5, A6) -> R)> for dyn Fn(&A1, A2, A3, A4, A5, A6) -> R
where A1: RefFromBinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, A3: BinaryDecode + EncodeTypeDef + 'static, A4: BinaryDecode + EncodeTypeDef + 'static, A5: BinaryDecode + EncodeTypeDef + 'static, A6: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2, A3, A4, A5, A6> WasmClosure<(BorrowedFirstArg, fn(&A1, A2, A3, A4, A5, A6) -> R)> for dyn FnMut(&A1, A2, A3, A4, A5, A6) -> R
where A1: RefFromBinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, A3: BinaryDecode + EncodeTypeDef + 'static, A4: BinaryDecode + EncodeTypeDef + 'static, A5: BinaryDecode + EncodeTypeDef + 'static, A6: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2, A3, A4, A5, A6> WasmClosure<fn(A1, A2, A3, A4, A5, A6) -> R> for dyn Fn(A1, A2, A3, A4, A5, A6) -> R
where A1: BinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, A3: BinaryDecode + EncodeTypeDef + 'static, A4: BinaryDecode + EncodeTypeDef + 'static, A5: BinaryDecode + EncodeTypeDef + 'static, A6: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2, A3, A4, A5, A6> WasmClosure<fn(A1, A2, A3, A4, A5, A6) -> R> for dyn FnMut(A1, A2, A3, A4, A5, A6) -> R
where A1: BinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, A3: BinaryDecode + EncodeTypeDef + 'static, A4: BinaryDecode + EncodeTypeDef + 'static, A5: BinaryDecode + EncodeTypeDef + 'static, A6: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2, A3, A4, A5, A6, A7> WasmClosure<(BorrowedFirstArg, fn(&A1, A2, A3, A4, A5, A6, A7) -> R)> for dyn Fn(&A1, A2, A3, A4, A5, A6, A7) -> R
where A1: RefFromBinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, A3: BinaryDecode + EncodeTypeDef + 'static, A4: BinaryDecode + EncodeTypeDef + 'static, A5: BinaryDecode + EncodeTypeDef + 'static, A6: BinaryDecode + EncodeTypeDef + 'static, A7: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2, A3, A4, A5, A6, A7> WasmClosure<(BorrowedFirstArg, fn(&A1, A2, A3, A4, A5, A6, A7) -> R)> for dyn FnMut(&A1, A2, A3, A4, A5, A6, A7) -> R
where A1: RefFromBinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, A3: BinaryDecode + EncodeTypeDef + 'static, A4: BinaryDecode + EncodeTypeDef + 'static, A5: BinaryDecode + EncodeTypeDef + 'static, A6: BinaryDecode + EncodeTypeDef + 'static, A7: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2, A3, A4, A5, A6, A7> WasmClosure<fn(A1, A2, A3, A4, A5, A6, A7) -> R> for dyn Fn(A1, A2, A3, A4, A5, A6, A7) -> R
where A1: BinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, A3: BinaryDecode + EncodeTypeDef + 'static, A4: BinaryDecode + EncodeTypeDef + 'static, A5: BinaryDecode + EncodeTypeDef + 'static, A6: BinaryDecode + EncodeTypeDef + 'static, A7: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Source§

impl<R, A1, A2, A3, A4, A5, A6, A7> WasmClosure<fn(A1, A2, A3, A4, A5, A6, A7) -> R> for dyn FnMut(A1, A2, A3, A4, A5, A6, A7) -> R
where A1: BinaryDecode + EncodeTypeDef + 'static, A2: BinaryDecode + EncodeTypeDef + 'static, A3: BinaryDecode + EncodeTypeDef + 'static, A4: BinaryDecode + EncodeTypeDef + 'static, A5: BinaryDecode + EncodeTypeDef + 'static, A6: BinaryDecode + EncodeTypeDef + 'static, A7: BinaryDecode + EncodeTypeDef + 'static, R: BinaryEncode + EncodeTypeDef + 'static,

Source§

fn into_js_closure(boxed: Box<Self>) -> Closure<Self>

Implementors§