pub trait FromWasm: Sized {
type Wire;
// Required method
fn from_wire(wire: Self::Wire) -> Result<Self, WireError>;
}Expand description
A type that can be received from JavaScript, crossing the ABI as Self::Wire.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<T: FromWasm> FromWasm for Vec<T>
Vec<T> crosses as a vector of T’s wire type, so Vec<u8> stays Vec<u8> and reaches
JavaScript as a Uint8Array, while Vec<CipherView> becomes Vec<Ts<CipherView>>.
impl<T: FromWasm> FromWasm for Vec<T>
Vec<T> crosses as a vector of T’s wire type, so Vec<u8> stays Vec<u8> and reaches
JavaScript as a Uint8Array, while Vec<CipherView> becomes Vec<Ts<CipherView>>.
Ts sits on the element, never the vector: Ts<Vec<T>> is not something tsify supports.
Implementors§
Source§impl<T: Tsify> FromWasm for Ts<T>
Lets a shim name Ts<T> in a signature it was handed already-wrapped, for the hand-written
extern "C" blocks that construct the wrapper themselves.
impl<T: Tsify> FromWasm for Ts<T>
Lets a shim name Ts<T> in a signature it was handed already-wrapped, for the hand-written
extern "C" blocks that construct the wrapper themselves.
Source§impl<T> FromWasm for LargeVec<T>where
T: Tsify + DeserializeOwned + 'static,
T::JsType: WasmDescribeVector,
Crosses as itself: the items convert when they are read, so there is nothing to convert
at the boundary.
impl<T> FromWasm for LargeVec<T>where
T: Tsify + DeserializeOwned + 'static,
T::JsType: WasmDescribeVector,
Crosses as itself: the items convert when they are read, so there is nothing to convert at the boundary.