Struct RustixBackend

Source
pub struct RustixBackend {
    pub datastore: Datastore,
    pub persistencer: FilePersister,
}

Fields§

§datastore: Datastore§persistencer: FilePersister

Trait Implementations§

Source§

impl Debug for RustixBackend

Source§

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

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

impl WriteBackend for RustixBackend

Source§

fn create_bill( &mut self, timestamp_from: i64, timestamp_to: i64, user_ids: UserGroup, comment: String, ) -> bool

Source§

fn create_item( &mut self, itemname: String, price_cents: u32, category: Option<String>, ) -> bool

Source§

fn create_user(&mut self, username: String) -> bool

Source§

fn delete_user(&mut self, user_id: u32) -> bool

Source§

fn delete_item(&mut self, item_id: u32) -> bool

Source§

fn purchase( &mut self, user_id: u32, item_id: u32, millis_timestamp: i64, ) -> bool

Source§

fn reload(&mut self) -> Result<u64, RustixError>

Source§

fn undo_purchase(&mut self, unique_id: u64) -> bool

Source§

fn special_purchase( &mut self, user_id: u32, special_name: String, millis_timestamp: i64, ) -> bool

Source§

fn ffa_purchase( &mut self, ffa_id: u64, item_id: u32, millis_timestamp: i64, ) -> bool

Source§

fn create_ffa( &mut self, allowed_categories: Vec<String>, allowed_drinks: Vec<u32>, allowed_number_total: u16, text_message: String, created_timestamp: i64, donor: u32, ) -> bool

Source§

fn create_free_budget( &mut self, cents_worth_total: u64, text_message: String, created_timestamp: i64, donor: u32, recipient: u32, ) -> bool

Source§

fn create_free_count( &mut self, allowed_categories: Vec<String>, allowed_drinks: Vec<u32>, allowed_number_total: u16, text_message: String, created_timestamp: i64, donor: u32, recipient: u32, ) -> bool

Source§

fn cart_purchase( &mut self, user_id: u32, specials: Vec<String>, item_ids: Vec<u32>, millis_timestamp: i64, ) -> bool

Source§

fn update_item( &mut self, item_id: u32, itemname: String, price_cents: u32, category: Option<String>, ) -> bool

Source§

fn update_user( &mut self, user_id: u32, username: String, is_billed: bool, is_highlighted: bool, external_user_id: Option<String>, is_sepa: bool, ) -> bool

Source§

fn apply(&mut self, event: &BLEvents) -> bool

Source§

fn snapshot(&mut self) -> Option<u64>

Source§

fn load_snapshot(&mut self) -> Option<u64>

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.