amethystate 0.9.3

Type-safe reactive persistence for Rust GUI apps
Documentation
//! Persistent reactive state for Rust GUI apps.

#![allow(clippy::complexity)]
mod codec;
mod global;
mod macros;

pub mod migration;
pub mod observability;
pub mod reactive;
pub mod store;

pub type AmeData<T> = <T as AmeState>::Data;
pub type MigrationResult<T> = StorageResult<T>;

pub use inventory;
pub use serde;
pub use uuid;

pub use reactive::{
    AccessMode, AmeState, AmeStateNode, Change, Field, InterceptDisposer, IntoPipeline, MapChange,
    MapEntrySignal, Pipeline, Reactive, ReactiveMap, ReactiveMapKey, ReactiveMapValue,
    ReactiveScope, ReadOnly, ReadOnlyField, ReadOnlyMode, Signal, SignalSubscription,
    StoreSubscription, Writable, WritableField, WritableMode,
};

pub mod errors {
    pub use crate::reactive::error::{FieldError, ReactiveMapError};
    pub use crate::store::StorageError;
}
pub mod stores {
    pub use crate::store::default::*;
}

pub use store::{
    AmeStateSlice, StateScope, StorageResult, StoreEvent, StoreOp, SubscriptionKind,
    builder::StoreBuilder, config::StoreConfig, default::DefaultStore, join_path,
};

pub use migration::{MigrationContext, MigrationError, MigrationPlan, MigrationReport};

pub use amethystate_macros::{AmeType, amethystate, migrate};
pub use global::*;

#[cfg(any(feature = "tauri", feature = "json"))]
pub use serde_json;
pub use store::Store;

#[cfg(any(feature = "confy-compat", feature = "confy-compat-0-6"))]
pub mod confy;

#[cfg(any(feature = "test-utils", test))]
pub mod test_utils;

#[cfg(feature = "tauri")]
pub mod tauri {
    pub use amethystate_core::scheme::*;
    pub use amethystate_tauri::*;
}

pub mod core {
    pub use amethystate_core::*;
}

#[cfg(any(feature = "async", feature = "tauri"))]
pub mod client {
    pub use amethystate_core::AmeBackendAsync;
    pub use amethystate_core::AmeStateSliceAsync;
    pub use amethystate_core::async_impl::*;

    use amethystate_core::async_impl::Field as CoreField;
    use amethystate_core::async_impl::ReactiveMap as CoreReactiveMap;
    #[cfg(feature = "tauri")]
    pub type ReactiveMap<K, V, B = crate::tauri::TauriBackend> = CoreReactiveMap<K, V, B>;

    #[cfg(all(feature = "async", not(feature = "tauri")))]
    pub type ReactiveMap<K, V, B> = CoreReactiveMap<K, V, B>;

    #[cfg(feature = "tauri")]
    pub type Field<V, B = crate::tauri::TauriBackend> = CoreField<V, B>;

    #[cfg(all(feature = "async", not(feature = "tauri")))]
    pub type Field<V, B> = CoreField<V, B>;
}