Not fully tested, mostly working

This commit is contained in:
2021-03-14 16:08:26 -04:00
commit ae6868975f
16 changed files with 1379 additions and 0 deletions

14
src/stores/mod.rs Normal file
View File

@@ -0,0 +1,14 @@
pub mod mem;
pub use mem::MemActStore;
use crate::types::Account;
pub trait ActStore {
fn get_account(&self, client: u16) -> Option<&Account>;
fn deposit(&mut self, client: u16, amnt: u64) -> u64;
fn withdraw(&mut self, client: u16, amnt: u64) -> u64;
fn hold(&mut self, client: u16, amnt: u64) -> u64;
fn unhold(&mut self, client: u16, amnt: u64) -> u64;
fn lock_account(&mut self, client: u16) -> bool;
fn unlock_account(&mut self, client: u16) -> bool;
}