Skip to main content

state_bridge

Macro state_bridge 

Source
state_bridge!() { /* proc-macro */ }
Expand description

Generates the full state bridge surface for a fixed list of fields.

Each field expands to:

  1. Three methods on the StateBridgeImpl trait (set_$name, get_$name, clear_$name).
  2. Three corresponding wrapper methods on StateBridge.
  3. Three corresponding methods on StateBridgeClient.
  4. Three method declarations on the WASM RawWasmStateBridge extern type and three forwarders in the StateBridgeImpl impl for WasmStateBridge.
  5. Three lines in the WasmStateBridge TypeScript interface.
  6. One field on test_support::InMemoryStateBridge and three forwarders in its StateBridgeImpl impl, gated on #[cfg(test)].

All fields share the same shape: set_$name(value: $ty), get_$name() -> Option<$ty>, clear_$name().