pub struct CommodityCostMap(HashMap<CommodityCostKey, CommodityCost>);
Expand description
A data structure for easy lookup of CommodityCost
s
Tuple Fields§
§0: HashMap<CommodityCostKey, CommodityCost>
Implementations§
Source§impl CommodityCostMap
impl CommodityCostMap
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new, empty CommodityCostMap
Sourcepub fn insert(
&mut self,
region_id: Rc<str>,
year: u32,
time_slice: TimeSliceID,
value: CommodityCost,
) -> Option<CommodityCost>
pub fn insert( &mut self, region_id: Rc<str>, year: u32, time_slice: TimeSliceID, value: CommodityCost, ) -> Option<CommodityCost>
Insert a CommodityCost
into the map
Sourcepub fn get(
&self,
region_id: Rc<str>,
year: u32,
time_slice: TimeSliceID,
) -> Option<&CommodityCost>
pub fn get( &self, region_id: Rc<str>, year: u32, time_slice: TimeSliceID, ) -> Option<&CommodityCost>
Retrieve a CommodityCost
from the map
Trait Implementations§
Source§impl Debug for CommodityCostMap
impl Debug for CommodityCostMap
Source§impl Default for CommodityCostMap
impl Default for CommodityCostMap
Source§fn default() -> CommodityCostMap
fn default() -> CommodityCostMap
Returns the “default value” for a type. Read more
Source§impl PartialEq for CommodityCostMap
impl PartialEq for CommodityCostMap
impl StructuralPartialEq for CommodityCostMap
Auto Trait Implementations§
impl Freeze for CommodityCostMap
impl RefUnwindSafe for CommodityCostMap
impl !Send for CommodityCostMap
impl !Sync for CommodityCostMap
impl Unpin for CommodityCostMap
impl UnwindSafe for CommodityCostMap
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