Improve database type safety

The database is now bound to a type eg. alice::State or bob::State.
The caller cannot expect to retrieve a type that is different to
the type that was stored.
This commit is contained in:
rishflab 2020-10-22 13:34:01 +11:00
parent 8eda051087
commit e3b68a3864
4 changed files with 28 additions and 24 deletions

View file

@ -82,7 +82,7 @@ pub async fn next_state<
}
#[allow(clippy::large_enum_variant)]
#[derive(Debug)]
#[derive(Debug, Deserialize, Serialize)]
pub enum State {
State0(State0),
State1(State1),

View file

@ -82,7 +82,7 @@ pub async fn next_state<
}
}
#[derive(Debug)]
#[derive(Debug, Deserialize, Serialize)]
pub enum State {
State0(State0),
State1(State1),