Expand description
Proc macros for FFI bindings (WASM, UniFFI).
Provides:
#[wasm_export]attribute macro for an impl block or free function exported to JavaScript.#[wasm_record]attribute macro for a type that crosses the ABI through serde.#[wasm_object]attribute macro for a type that crosses the ABI as a handle.
Each macro replaces the attribute it stands in for rather than decorating it, so an item
carries one of these and no #[wasm_bindgen] or #[tsify] of its own. That is what lets the
expansion change without touching call sites.
An expansion names only bitwarden_ffi, so a call site imports nothing โ but the crate has to
forward its own wasm feature to bitwarden-ffi/wasm, which is where those names live.
Modulesยง
- attrs ๐
- wasm_
export ๐ - wasm_
object ๐ - wasm_
record ๐
Attribute Macrosยง
- wasm_
export - Exports an impl block or a free function to JavaScript, in place of
#[cfg_attr(feature = "wasm", wasm_bindgen(..))]. - 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))].