1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
mod current;
pub use current::{Data, State};
use serde_derive::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
pub enum Versions {
Current(Box<State>),
}
impl Versions {
pub fn new_current(state: State) -> Self {
Self::Current(Box::new(state))
}
pub fn convert_to_current(self) -> State {
match self {
Self::Current(state) => *state,
}
}
}