pub struct AssetPool {
assets: Vec<Asset>,
current_year: u32,
}
Expand description
A pool of Asset
s
Fields§
§assets: Vec<Asset>
The pool of assets, both active and yet to be commissioned.
Sorted in order of commission year.
current_year: u32
Current milestone year.
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
Sourcepub fn decomission_old(&mut self, year: u32)
pub fn decomission_old(&mut self, year: u32)
Decommission old assets for the specified milestone year
Sourcepub fn iter_for_region<'a>(
&'a self,
region_id: &'a RegionID,
) -> impl Iterator<Item = &'a Asset>
pub fn iter_for_region<'a>( &'a self, region_id: &'a RegionID, ) -> impl Iterator<Item = &'a Asset>
Iterate over active assets for a particular region
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