pub struct Account {
pub id: AccountID,
pub name: Option<String>,
pub commodity_type_id: CommodityTypeID,
pub category: Option<AccountCategory>,
}Expand description
Details for an account, which holds a Commodity with a type of CommodityType.
Fields§
§id: AccountIDA unique identifier for this Account, currently generated using nanoid.
name: Option<String>The name of this Account
commodity_type_id: CommodityTypeIDThe id of the type of commodity to be stored in this account
category: Option<AccountCategory>The category that this account part of
Implementations§
Source§impl Account
impl Account
Sourcepub fn new_with_id<S: Into<String>>(
name: Option<S>,
commodity_type_id: CommodityTypeID,
category: Option<AccountCategory>,
) -> Account
pub fn new_with_id<S: Into<String>>( name: Option<S>, commodity_type_id: CommodityTypeID, category: Option<AccountCategory>, ) -> Account
Create a new account with an automatically generated id (using nanoid) and add it to this program state (and create its associated AccountState).
Sourcepub fn new<S: Into<String>>(
id: AccountID,
name: Option<S>,
commodity_type_id: CommodityTypeID,
category: Option<AccountCategory>,
) -> Account
pub fn new<S: Into<String>>( id: AccountID, name: Option<S>, commodity_type_id: CommodityTypeID, category: Option<AccountCategory>, ) -> Account
Create a new account and add it to this program state (and create its associated AccountState).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Account
impl<'de> Deserialize<'de> for Account
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Account
impl RefUnwindSafe for Account
impl Send for Account
impl Sync for Account
impl Unpin for Account
impl UnwindSafe for Account
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more