Skip to main content

Module debug

Module debug 

Source
Expand description

Dev-only generic debug browse over registered repositories. Compiled only under the debug-capabilities feature; never ship in production. Dev-only generic debug browse over the registry’s repositories.

StateDebug is the exposed handle: a typed browse over every registered repository, addressed by string type name and key, for automated tooling that needs to reach state the type-safe public API does not expose generically. It reads through a parallel index of per-type get/set/list shims, captured where each type is still known (client-managed registration and the SDK-managed migration path) and dispatched by the repository’s string name. Compiled only under the debug-capabilities feature; never ship in production.

The registration logic is covered by the unit test below (run under --all-features). CI never builds the feature into a wasm/mobile artifact, so the generated binding surface is verified by hand: crates/bitwarden-wasm-internal/build.sh -d, then the integration-tests debug().state() browse.

Structs§

DebugRegistry 🔒
Index of per-type shims, keyed by TypeId. Held by StateRegistry so the generic debug surface can address any registered repository by its string name and key.
DebugRepo 🔒
Monomorphized get/set/list shims for one repository type, so the registry can offer generic string-addressed access without naming the type. Captured at the point where the concrete type is still known.
StateDebug
Typed debug handle over the SDK’s state registry: a generic browse across every registered repository, both client-managed and SDK-managed.

Traits§

StateRegistryDebugExt
Yields the debug handle for a state registry.

Functions§

get_repo 🔒
Read one item from the T repository by its string key, as JSON.
list_repo 🔒
List every item in the T repository (client- or SDK-managed) as JSON.
set_repo 🔒
Write one item to the T repository at its string key. Returns false on a bad key, a value that does not deserialize to T, or a failed write.

Type Aliases§

DebugFuture 🔒
A future borrowing the registry, boxed so it can cross a fn pointer. Send so the handle’s async methods can run on a multi-threaded runtime (uniffi).
DebugGetFn 🔒
Shim: read one item by string key as JSON.
DebugListFn 🔒
Shim: list a repository’s values as JSON.
DebugSetFn 🔒
Shim: write one item by string key. Reports whether the write landed.