Expand description
Type-safe state management for plugins.
Provides an ergonomic API for storing and retrieving plugin state.
§Example
ⓘ
use orbis_plugin_api::sdk::state;
// Set a value
state::set("counter", &42)?;
// Get a value
let counter: i32 = state::get("counter")?.unwrap_or(0);
// Remove a value
state::remove("counter")?;Structs§
- Scoped
State - Scoped state access with a prefix.
Functions§
- decrement
- Decrement a numeric value in state.
- exists
- Check if a key exists in state (non-WASM stub)
- get
- Get a value from plugin state (non-WASM stub)
- get_or
- Get a value or return a default.
- get_
or_ else - Get a value or compute a default.
- increment
- Increment a numeric value in state.
- len
- Get the length of a list in state.
- push
- Append to a list in state.
- remove
- Remove a value from plugin state (non-WASM stub)
- scoped
- Create a scoped state accessor
- set
- Set a value in plugin state (non-WASM stub)
- update
- Update a value in state using a function.