pub struct FixedAssetPool {
pub assets: Vec<FixedAsset>,
/* private fields */
}Expand description
Pool of fixed assets for transaction generation.
Fields§
§assets: Vec<FixedAsset>All fixed assets
Implementations§
Source§impl FixedAssetPool
impl FixedAssetPool
Sourcepub fn add_asset(&mut self, asset: FixedAsset)
pub fn add_asset(&mut self, asset: FixedAsset)
Add an asset to the pool.
Sourcepub fn get_depreciable_assets(&self) -> Vec<&FixedAsset>
pub fn get_depreciable_assets(&self) -> Vec<&FixedAsset>
Get all assets requiring depreciation for a given month.
Sourcepub fn get_depreciable_assets_mut(&mut self) -> Vec<&mut FixedAsset>
pub fn get_depreciable_assets_mut(&mut self) -> Vec<&mut FixedAsset>
Get mutable references to depreciable assets.
Sourcepub fn get_by_company(&self, company_code: &str) -> Vec<&FixedAsset>
pub fn get_by_company(&self, company_code: &str) -> Vec<&FixedAsset>
Get assets by company code.
Sourcepub fn get_by_class(&self, asset_class: AssetClass) -> Vec<&FixedAsset>
pub fn get_by_class(&self, asset_class: AssetClass) -> Vec<&FixedAsset>
Get assets by class.
Sourcepub fn get_by_id(&self, asset_id: &str) -> Option<&FixedAsset>
pub fn get_by_id(&self, asset_id: &str) -> Option<&FixedAsset>
Get asset by ID.
Sourcepub fn get_by_id_mut(&mut self, asset_id: &str) -> Option<&mut FixedAsset>
pub fn get_by_id_mut(&mut self, asset_id: &str) -> Option<&mut FixedAsset>
Get mutable asset by ID.
Sourcepub fn calculate_period_depreciation(&self, as_of_date: NaiveDate) -> Decimal
pub fn calculate_period_depreciation(&self, as_of_date: NaiveDate) -> Decimal
Calculate total depreciation for all assets in a period.
Sourcepub fn total_net_book_value(&self) -> Decimal
pub fn total_net_book_value(&self) -> Decimal
Get total net book value.
Sourcepub fn rebuild_indices(&mut self)
pub fn rebuild_indices(&mut self)
Rebuild indices after deserialization.
Trait Implementations§
Source§impl Clone for FixedAssetPool
impl Clone for FixedAssetPool
Source§fn clone(&self) -> FixedAssetPool
fn clone(&self) -> FixedAssetPool
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FixedAssetPool
impl Debug for FixedAssetPool
Source§impl Default for FixedAssetPool
impl Default for FixedAssetPool
Source§fn default() -> FixedAssetPool
fn default() -> FixedAssetPool
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for FixedAssetPool
impl<'de> Deserialize<'de> for FixedAssetPool
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 FixedAssetPool
impl RefUnwindSafe for FixedAssetPool
impl Send for FixedAssetPool
impl Sync for FixedAssetPool
impl Unpin for FixedAssetPool
impl UnwindSafe for FixedAssetPool
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