pub struct AssetPool {
active: Vec<AssetRef>,
future: Vec<Asset>,
next_id: u32,
}
Expand description
A pool of Asset
s
Fields§
§active: Vec<AssetRef>
The pool of active assets
future: Vec<Asset>
Assets that have not yet been commissioned, sorted by commission year
next_id: u32
Next available asset ID number
Implementations§
Source§impl AssetPool
impl AssetPool
Sourcepub fn commission_new(&mut self, year: u32)
pub fn commission_new(&mut self, year: u32)
Commission new assets for the specified milestone year from the input data
Sourcepub fn decommission_old(&mut self, year: u32)
pub fn decommission_old(&mut self, year: u32)
Decommission old assets for the specified milestone year
Sourcepub fn replace_active_pool<I>(&mut self, assets: I)
pub fn replace_active_pool<I>(&mut self, assets: I)
Replace the active pool with new and/or already commissioned assets
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