Skip to main content

Crate bitwarden_ffi

Crate bitwarden_ffi 

Source
Expand description

Utilities for FFI bindings (WASM, UniFFI).

Re-exports proc macros from bitwarden-ffi-macro, plus the wire traits. FromWasm and ToWasm explain how a type crosses the wasm ABI.

Modules§

wire 🔒
How a type crosses the wasm ABI.
wire_macros 🔒
The impl_wire_* macros, which implement the wire traits.

Macros§

impl_wire_object
Implements both traits for a type that crosses as itself: a #[wasm_bindgen] handle, an extern "C" type, or a primitive wasm_bindgen already understands.
impl_wire_string
Implements the traits for a type that crosses as a String, so a malformed string is a WireError::Parse rather than a throw from inside FromWasmAbi.

Enums§

WireError
A value could not be converted across the wasm ABI.

Traits§

FromWasm
A type that can be received from JavaScript, crossing the ABI as Self::Wire.
ToWasm
A type that can be handed to JavaScript, crossing the ABI as Self::Wire.

Attribute Macros§

wasm_export
Exports an impl block or a free function to JavaScript, in place of #[cfg_attr(feature = "wasm", wasm_bindgen(..))].
wasm_import
Declares a block of JavaScript imports, in place of #[wasm_bindgen] on an extern "C" block.
wasm_object
Declares a type that crosses the wasm ABI as an opaque handle, in place of #[cfg_attr(feature = "wasm", wasm_bindgen(..))] on a struct or an enum.
wasm_record
Declares a type that crosses the wasm ABI through serde, in place of #[cfg_attr(feature = "wasm", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))].