Skip to main content

Crate amethystate

Crate amethystate 

Source
Expand description

Persistent reactive state for Rust GUI apps.

Re-exports§

pub use reactive::AmeState;
pub use reactive::AmeStateNode;
pub use reactive::Field;
pub use reactive::ReactiveCell;
pub use reactive::ReactiveMap;
pub use store::StoreSubscription;
pub use store::AmeStateSlice;
pub use store::Open;
pub use store::Schema;
pub use store::StateScope;
pub use store::StoreEvent;
pub use store::StoreOp;
pub use store::SubscriptionKind;
pub use store::builder::StoreBuilder;
pub use store::config::StoreConfig;
pub use store::default::Store;
pub use migration::MigrationContext;
pub use migration::MigrationError;
pub use migration::MigrationPlan;
pub use migration::MigrationReport;
pub use store::StoreBackend;
pub use store::StoreExt;
pub use erased_serde;
pub use error_stack;
pub use indexmap;
pub use inventory;
pub use serde;
pub use uuid;
pub use serde_json;

Modules§

client
errors
migration
observability
What a running program can say about its own state.
prelude
What an ordinary program needs, in one import.
reactive
Reactive primitives: values that persist and notify.
schema
What this binary declares, collected at link time.
shape
What a declared field’s type is, answered by the compiler.
store
stores

Macros§

migrate_field

Structs§

AlreadyInstalled
A store handed to install_global while another open one was in place, handed back untouched.
Change
GlobalStoreGuard
Closes the process-wide store when it goes out of scope.
Id
A key that is not a string, spelled once and kept that way.
ReactiveScope
Subscriptions held together, ending when the scope does.
SignalSubscription
Dropping this ends the subscription, so it has to be held for as long as the callback should keep firing. ReactiveScope is where several are held together.

Enums§

InitGlobal
Why the process-wide store was not put in place.
MapChange

Traits§

IntoGlobalStore
ReactiveMapKey
ReactiveMapValue

Functions§

global_store
The process-wide store.
init_global
Opens the process-wide store.
install_global
Puts a store that is already open in place as the process-wide one.
shutdown
Closes the process-wide store: writes what it still holds, stops its background thread and lets go of the file.
shutdown_async
shutdown, awaited rather than blocked on: the closing write runs without holding the thread that awaits it.

Type Aliases§

AmeData
MigrationResult
What a migration step answers with: everything it can fail at, and nothing else.
StorageResult

Attribute Macros§

amethystate
Generates a persistent state wrapper for a struct.
migrate
Declares a migration step, discovered wherever it is written.