amethystate-core 0.9.3

Internal crate for amethystate, not intended for direct use
Documentation
use thiserror::Error;

#[derive(Error, Debug)]
pub enum FieldError<TStorageError> {
    #[error(transparent)]
    StorageError(#[from] TStorageError),

    #[error("Change intercepted")]
    Intercepted,

    #[error("Key not found in Field: {0}")]
    KeyNotFound(String),
}

pub type ReactiveFieldResult<T, E> = std::result::Result<T, FieldError<E>>;

#[derive(Error, Debug)]
pub enum ReactiveMapError<TStorageError> {
    #[error(transparent)]
    StorageError(#[from] TStorageError),

    #[error("Change intercepted")]
    Intercepted,

    #[error("Key not found in ReactiveMap: {0}")]
    KeyNotFound(String),
}

pub type ReactiveMapResult<T, E> = std::result::Result<T, ReactiveMapError<E>>;