sycamore::web::js_sys::wasm_bindgen::convert

Trait FromWasmAbi

source
pub trait FromWasmAbi: WasmDescribe {
    type Abi: WasmAbi;

    // Required method
    unsafe fn from_abi(js: Self::Abi) -> Self;
}
Expand description

A trait for anything that can be recovered by-value from the Wasm ABI boundary, eg a Rust u8 can be recovered from the Wasm ABI u32 type.

This is the by-value variant of the opposite operation as IntoWasmAbi.

§⚠️ Unstable

This is part of the internal convert module, no stability guarantees are provided. Use at your own risk. See its documentation for more details.

Required Associated Types§

source

type Abi: WasmAbi

The Wasm ABI type that this converts from when coming back out from the ABI boundary.

Required Methods§

source

unsafe fn from_abi(js: Self::Abi) -> Self

Recover a Self from Self::Abi.

§Safety

This is only safe to call when – and implementations may assume that – the supplied Self::Abi was previously generated by a call to <Self as IntoWasmAbi>::into_abi() or the moral equivalent in JS.

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 FromWasmAbi for Option<f32>

source§

impl FromWasmAbi for Option<f64>

source§

impl FromWasmAbi for Option<i32>

source§

impl FromWasmAbi for Option<i64>

source§

impl FromWasmAbi for Option<isize>

source§

impl FromWasmAbi for Option<u32>

source§

impl FromWasmAbi for Option<u64>

source§

impl FromWasmAbi for Option<usize>

source§

impl FromWasmAbi for bool

source§

type Abi = u32

source§

unsafe fn from_abi(js: u32) -> bool

source§

impl FromWasmAbi for char

source§

type Abi = u32

source§

unsafe fn from_abi(js: u32) -> char

source§

impl FromWasmAbi for f32

source§

type Abi = f32

source§

unsafe fn from_abi(js: f32) -> f32

source§

impl FromWasmAbi for f64

source§

type Abi = f64

source§

unsafe fn from_abi(js: f64) -> f64

source§

impl FromWasmAbi for i8

source§

type Abi = u32

source§

unsafe fn from_abi(js: u32) -> i8

source§

impl FromWasmAbi for i16

source§

type Abi = u32

source§

unsafe fn from_abi(js: u32) -> i16

source§

impl FromWasmAbi for i32

source§

type Abi = i32

source§

unsafe fn from_abi(js: i32) -> i32

source§

impl FromWasmAbi for i64

source§

type Abi = i64

source§

unsafe fn from_abi(js: i64) -> i64

source§

impl FromWasmAbi for isize

source§

type Abi = i32

source§

unsafe fn from_abi(js: i32) -> isize

source§

impl FromWasmAbi for u8

source§

type Abi = u32

source§

unsafe fn from_abi(js: u32) -> u8

source§

impl FromWasmAbi for u16

source§

type Abi = u32

source§

unsafe fn from_abi(js: u32) -> u16

source§

impl FromWasmAbi for u32

source§

type Abi = u32

source§

unsafe fn from_abi(js: u32) -> u32

source§

impl FromWasmAbi for u64

source§

type Abi = u64

source§

unsafe fn from_abi(js: u64) -> u64

source§

impl FromWasmAbi for usize

source§

type Abi = u32

source§

unsafe fn from_abi(js: u32) -> usize

source§

impl FromWasmAbi for String

source§

impl FromWasmAbi for CharacterData

source§

impl FromWasmAbi for Comment

source§

impl FromWasmAbi for Document

source§

impl FromWasmAbi for DocumentFragment

source§

impl FromWasmAbi for Element

source§

impl FromWasmAbi for EventListener

source§

impl FromWasmAbi for EventTarget

source§

impl FromWasmAbi for HtmlElement

source§

impl FromWasmAbi for Node

source§

impl FromWasmAbi for NodeList

source§

impl FromWasmAbi for Text

source§

impl FromWasmAbi for Window

source§

impl<T> FromWasmAbi for Option<*const T>

source§

impl<T> FromWasmAbi for Option<*mut T>

source§

impl<T> FromWasmAbi for Option<T>

source§

type Abi = <T as FromWasmAbi>::Abi

source§

unsafe fn from_abi(js: <T as FromWasmAbi>::Abi) -> Option<T>

source§

impl<T> FromWasmAbi for *const T

source§

type Abi = u32

source§

unsafe fn from_abi(js: u32) -> *const T

source§

impl<T> FromWasmAbi for *mut T

source§

type Abi = u32

source§

unsafe fn from_abi(js: u32) -> *mut T

source§

impl<T> FromWasmAbi for Box<[T]>

source§

type Abi = <T as VectorFromWasmAbi>::Abi

source§

unsafe fn from_abi(js: <Box<[T]> as FromWasmAbi>::Abi) -> Box<[T]>

source§

impl<T> FromWasmAbi for Vec<T>
where Box<[T]>: FromWasmAbi<Abi = WasmSlice>,

source§

type Abi = <Box<[T]> as FromWasmAbi>::Abi

source§

unsafe fn from_abi(js: <Vec<T> as FromWasmAbi>::Abi) -> Vec<T>

source§

impl<T> FromWasmAbi for NonNull<T>

source§

type Abi = u32

source§

unsafe fn from_abi(js: <NonNull<T> as FromWasmAbi>::Abi) -> NonNull<T>

Implementors§

source§

impl FromWasmAbi for AnimationEvent

source§

impl FromWasmAbi for BeforeUnloadEvent

source§

impl FromWasmAbi for CompositionEvent

source§

impl FromWasmAbi for DeviceMotionEvent

source§

impl FromWasmAbi for DeviceOrientationEvent

source§

impl FromWasmAbi for DragEvent

source§

impl FromWasmAbi for ErrorEvent

source§

impl FromWasmAbi for Event

source§

impl FromWasmAbi for FocusEvent

source§

impl FromWasmAbi for GamepadEvent

source§

impl FromWasmAbi for HashChangeEvent

source§

impl FromWasmAbi for InputEvent

source§

impl FromWasmAbi for KeyboardEvent

source§

impl FromWasmAbi for MessageEvent

source§

impl FromWasmAbi for MouseEvent

source§

impl FromWasmAbi for PageTransitionEvent

source§

impl FromWasmAbi for PointerEvent

source§

impl FromWasmAbi for PopStateEvent

source§

impl FromWasmAbi for ProgressEvent

source§

impl FromWasmAbi for PromiseRejectionEvent

source§

impl FromWasmAbi for SecurityPolicyViolationEvent

source§

impl FromWasmAbi for StorageEvent

source§

impl FromWasmAbi for SubmitEvent

source§

impl FromWasmAbi for TouchEvent

source§

impl FromWasmAbi for TransitionEvent

source§

impl FromWasmAbi for UiEvent

source§

impl FromWasmAbi for WheelEvent

source§

impl FromWasmAbi for Collator

source§

impl FromWasmAbi for DateTimeFormat

source§

impl FromWasmAbi for NumberFormat

source§

impl FromWasmAbi for PluralRules

source§

impl FromWasmAbi for RelativeTimeFormat

source§

impl FromWasmAbi for CompileError

source§

impl FromWasmAbi for Exception

source§

impl FromWasmAbi for Global

source§

impl FromWasmAbi for Instance

source§

impl FromWasmAbi for LinkError

source§

impl FromWasmAbi for Memory

source§

impl FromWasmAbi for Module

source§

impl FromWasmAbi for RuntimeError

source§

impl FromWasmAbi for Table

source§

impl FromWasmAbi for Tag

source§

impl FromWasmAbi for Array

source§

impl FromWasmAbi for ArrayBuffer

source§

impl FromWasmAbi for AsyncIterator

source§

impl FromWasmAbi for BigInt64Array

source§

impl FromWasmAbi for BigInt

source§

impl FromWasmAbi for BigUint64Array

source§

impl FromWasmAbi for Boolean

source§

impl FromWasmAbi for DataView

source§

impl FromWasmAbi for Date

source§

impl FromWasmAbi for Error

source§

impl FromWasmAbi for EvalError

source§

impl FromWasmAbi for Float32Array

source§

impl FromWasmAbi for Float64Array

source§

impl FromWasmAbi for Function

source§

impl FromWasmAbi for Generator

source§

impl FromWasmAbi for Int8Array

source§

impl FromWasmAbi for Int16Array

source§

impl FromWasmAbi for Int32Array

source§

impl FromWasmAbi for Iterator

source§

impl FromWasmAbi for IteratorNext

source§

impl FromWasmAbi for JsString

source§

impl FromWasmAbi for Map

source§

impl FromWasmAbi for Number

source§

impl FromWasmAbi for Object

source§

impl FromWasmAbi for Promise

source§

impl FromWasmAbi for Proxy

source§

impl FromWasmAbi for RangeError

source§

impl FromWasmAbi for ReferenceError

source§

impl FromWasmAbi for RegExp

source§

impl FromWasmAbi for Set

source§

impl FromWasmAbi for SharedArrayBuffer

source§

impl FromWasmAbi for Symbol

source§

impl FromWasmAbi for SyntaxError

source§

impl FromWasmAbi for TypeError

source§

impl FromWasmAbi for Uint8Array

source§

impl FromWasmAbi for Uint8ClampedArray

source§

impl FromWasmAbi for Uint16Array

source§

impl FromWasmAbi for Uint32Array

source§

impl FromWasmAbi for UriError

source§

impl FromWasmAbi for WeakMap

source§

impl FromWasmAbi for WeakSet

source§

impl FromWasmAbi for JsValue

source§

impl<T> FromWasmAbi for Clamped<T>
where T: FromWasmAbi,

source§

type Abi = <T as FromWasmAbi>::Abi