pub struct AssetPool {
assets: Vec<AssetRef>,
next_id: u32,
next_group_id: u32,
}Expand description
The active pool of super::Assets
Fields§
§assets: Vec<AssetRef>The pool of active assets, sorted by ID
next_id: u32Next available asset ID number
next_group_id: u32Next available group ID number
Implementations§
Source§impl AssetPool
impl AssetPool
Sourcepub fn commission_new(&mut self, year: u32, user_assets: &mut Vec<AssetRef>)
pub fn commission_new(&mut self, year: u32, user_assets: &mut Vec<AssetRef>)
Commission new assets for the specified milestone year from the input data
Sourcefn commission(&mut self, asset: AssetRef, reason: &str)
fn commission(&mut self, asset: AssetRef, reason: &str)
Commission the specified asset or, if divisible, its children
Sourcepub fn decommission_old<E: Extend<AssetRef>>(
&mut self,
year: u32,
decommissioned: &mut E,
)
pub fn decommission_old<E: Extend<AssetRef>>( &mut self, year: u32, decommissioned: &mut E, )
Decommission old assets for the specified milestone year
Sourcepub fn decommission_mothballed<E: Extend<AssetRef>>(
&mut self,
year: u32,
mothball_years: u32,
decommissioned: &mut E,
)
pub fn decommission_mothballed<E: Extend<AssetRef>>( &mut self, year: u32, mothball_years: u32, decommissioned: &mut E, )
Decommission mothballed assets if mothballed long enough
Sourcepub fn mothball_unretained<I>(&mut self, assets: I, year: u32)where
I: IntoIterator<Item = AssetRef>,
pub fn mothball_unretained<I>(&mut self, assets: I, year: u32)where
I: IntoIterator<Item = AssetRef>,
Sourcepub fn extend<I>(&mut self, assets: I)where
I: IntoIterator<Item = AssetRef>,
pub fn extend<I>(&mut self, assets: I)where
I: IntoIterator<Item = AssetRef>,
Extend the active pool with Commissioned or Selected assets
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AssetPool
impl !RefUnwindSafe for AssetPool
impl !Send for AssetPool
impl !Sync for AssetPool
impl Unpin for AssetPool
impl !UnwindSafe for AssetPool
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more