blanket impl of Update.undo()
This commit is contained in:
@@ -42,7 +42,7 @@ pub fn create_pool() -> Pool {
|
||||
|
||||
|
||||
/// Every possible update which can happen during a query
|
||||
#[derive(Serialize, Debug)]
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub enum Update {
|
||||
Wealth(Wealth),
|
||||
ItemAdded(Item),
|
||||
@@ -51,6 +51,20 @@ pub enum Update {
|
||||
ClaimRemoved(Claim),
|
||||
}
|
||||
|
||||
impl Update {
|
||||
/// Change back what has been updated
|
||||
fn undo(self) -> QueryResult<()> {
|
||||
match self {
|
||||
Update::Wealth(diff) => {},
|
||||
Update::ItemAdded(item) => {},
|
||||
Update::ItemRemoved(item) => {},
|
||||
Update::ClaimAdded(claim) => {},
|
||||
Update::ClaimRemoved(claim) => {},
|
||||
};
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// Every value which can be queried
|
||||
#[derive(Debug)]
|
||||
pub enum Value {
|
||||
|
||||
Reference in New Issue
Block a user