Skip to main content

bitwarden_ffi/
lib.rs

1//! Utilities for FFI bindings (WASM, UniFFI).
2//!
3//! Re-exports proc macros from `bitwarden-ffi-macro`, plus the wire traits. [`FromWasm`] and
4//! [`ToWasm`] explain how a type crosses the wasm ABI.
5
6#[cfg(feature = "wasm")]
7mod wire;
8mod wire_macros;
9
10pub use bitwarden_ffi_macro::{wasm_export, wasm_import, wasm_object, wasm_record};
11#[cfg(feature = "wasm")]
12pub use wire::{FromWasm, ToWasm, WireError};
13#[cfg(feature = "wasm")]
14#[doc(hidden)]
15pub use wire::{format_wire_string, parse_wire_string};
16
17/// What the macro expansions name, so a call site imports nothing and names only this crate.
18///
19/// Not a public API.
20#[cfg(feature = "wasm")]
21#[doc(hidden)]
22pub mod _macro {
23    pub use ::wasm_bindgen::{self, prelude::wasm_bindgen};
24    pub use tsify::Tsify;
25}