use crate::core::model::State;
use anyhow::Result;

pub trait Store {
    fn load(&self) -> Result<State>;
    fn save(&self, state: &State) -> Result<()>;
}

impl Store for Box<dyn Store> {
    fn load(&self) -> Result<State> {
        self.as_ref().load()
    }
    fn save(&self, state: &State) -> Result<()> {
        self.as_ref().save(state)
    }
}

