Struct quad_diesel::models::Account [] [src]

pub struct Account {
    pub id: i32,
    pub username: String,
    pub balance: i32,
}

The account structure.

Fields

The unique identifier of the account.

The unique username of the account.

The amount of quadbucks in the account.

Methods

impl Account
[src]

Return all the accounts in the database.

Find an Account in the database by the username.

Create an Account from a NewAccount. Note this might error with a unique constraint error if the account with this username already exists.

Save all changes back to the database.

Transfer some amount quadbucks from this account to another account.

Trait Implementations

impl Debug for Account
[src]

Formats the value using the given formatter.

impl<'a, 'update> AsChangeset for &'update Account

impl HasTable for Account

impl<'ident> Identifiable for &'ident Account