Struct Datastore

Source
pub struct Datastore {
Show 22 fields pub version: u64, pub user_id_counter: u32, pub freeby_id_counter: u64, pub item_id_counter: u32, pub users: HashMap<u32, User>, pub users_suffix_tree: MockKDTree, pub items: HashMap<u32, Item>, pub items_suffix_tree: MockKDTree, pub purchases: Vec<Purchase>, pub purchase_count: u64, pub bills: Vec<Bill>, pub top_user_scores: ScoredIdTreeMock, pub top_users: HashSet<u32>, pub highlighted_users: HashSet<u32>, pub top_drinks_per_user: HashMap<u32, HashSet<u32>>, pub drink_scores_per_user: HashMap<u32, ScoredIdTreeMock>, pub balance_cost_per_user: HashMap<(u32, String), HashMap<(u32, String), u32>>, pub balance_count_per_user: HashMap<(u32, String), HashMap<(u32, String), u32>>, pub used_up_freebies: Vec<Freeby>, pub open_freebies: HashMap<u32, Vec<Freeby>>, pub open_ffa: Vec<Freeby>, pub categories: HashSet<String>,
}

Fields§

§version: u64§user_id_counter: u32§freeby_id_counter: u64§item_id_counter: u32§users: HashMap<u32, User>§users_suffix_tree: MockKDTree§items: HashMap<u32, Item>§items_suffix_tree: MockKDTree§purchases: Vec<Purchase>§purchase_count: u64§bills: Vec<Bill>§top_user_scores: ScoredIdTreeMock§top_users: HashSet<u32>§highlighted_users: HashSet<u32>§top_drinks_per_user: HashMap<u32, HashSet<u32>>§drink_scores_per_user: HashMap<u32, ScoredIdTreeMock>§balance_cost_per_user: HashMap<(u32, String), HashMap<(u32, String), u32>>§balance_count_per_user: HashMap<(u32, String), HashMap<(u32, String), u32>>§used_up_freebies: Vec<Freeby>§open_freebies: HashMap<u32, Vec<Freeby>>§open_ffa: Vec<Freeby>§categories: HashSet<String>

Trait Implementations§

Source§

impl DatastoreQueries for Datastore

Source§

fn get_purchase_timestamp(&self, purchase_id: u64) -> Option<i64>

Source§

fn top_user_ids(&self, n: u16) -> Vec<u32>

Source§

fn users_searchhit_ids(&self, searchterm: &str) -> Vec<u32>

Source§

fn items_searchhit_ids(&self, searchterm: &str) -> Vec<u32>

Source§

fn personal_log_filtered( &self, user_id: u32, millis_start_inclusive: i64, millis_end_exclusive: i64, ) -> Vec<Purchase>

Source§

fn global_log_filtered( &self, millis_start_inclusive: i64, millis_end_exclusive: i64, ) -> &[Purchase]

Source§

fn all_categories(&self) -> Vec<String>

Source§

fn top_item_ids(&self, user_id: u32, n: u8) -> Vec<u32>

Source§

fn bills_filtered( &self, user_id: Option<u32>, millis_start_inclusive: i64, millis_end_exclusive: i64, ) -> Vec<Bill>

Source§

fn get_mut_purchase(&mut self, id: &u64) -> Option<&mut Purchase>

Source§

fn get_mut_bill( &mut self, timestamp_from: i64, timestamp_to: i64, ) -> Option<&mut Bill>

Source§

fn get_bill_index( &mut self, timestamp_from: i64, timestamp_to: i64, ) -> Option<usize>

Source§

fn get_specials_to_bill( &self, timestamp_from: i64, timestamp_to: i64, ) -> Vec<u64>

Source§

fn get_users_to_bill(&self, timestamp_from: i64, timestamp_to: i64) -> Vec<u32>

Source§

fn get_un_set_users_to_bill( &self, timestamp_from: i64, timestamp_to: i64, ) -> Vec<u32>

Source§

fn get_unpriced_specials_to_bill( &self, timestamp_from: i64, timestamp_to: i64, ) -> Vec<u64>

Source§

fn get_bill(&self, timestamp_from: i64, timestamp_to: i64) -> Option<&Bill>

Source§

fn get_purchase_indices_to_bill(&self, bill: &Bill) -> Vec<usize>

Source§

fn remove_purchases_indices(&mut self, indices: Vec<usize>)

Source§

fn get_budget_freeby_id_useable_for(&self, recipient_id: u32) -> Option<usize>

Source§

fn get_count_freeby_id_useable_for( &self, recipient_id: u32, item: u32, ) -> Option<usize>

Source§

fn get_ffa_freeby(&self, id: u64) -> Option<&Freeby>

Source§

fn get_personal_freeby( &self, recipient_id: u32, freeby_id: u64, ) -> Option<&Freeby>

Source§

impl Debug for Datastore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Datastore

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Datastore

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Itemable for Datastore

Source§

fn has_item(&self, id: u32) -> bool

Source§

impl Purchaseable for Datastore

Source§

fn get_purchase(&self, id: u64) -> Option<Purchase>

Source§

fn get_purchase_mut(&mut self, id: u64) -> Option<&mut Purchase>

Source§

impl Serialize for Datastore

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl SuffixTreeRebuildable for Datastore

Source§

impl Userable for Datastore

Source§

fn has_user(&self, id: u32) -> bool

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,