blob: 50943367f99c011e86db7be304248a3f57c4c5e8 [file] [log] [blame]
use crate::state::command::EntryCommand;
use crate::state::entry::StateEntry;
use async_trait::async_trait;
use iggy::error::IggyError;
use std::fmt::Debug;
pub mod command;
pub mod entry;
pub mod file;
pub mod models;
pub mod system;
#[async_trait]
pub trait State: Send + Sync + Debug {
async fn init(&self) -> Result<Vec<StateEntry>, IggyError>;
async fn load_entries(&self) -> Result<Vec<StateEntry>, IggyError>;
async fn apply(&self, user_id: u32, command: EntryCommand) -> Result<(), IggyError>;
}