feat: impl Sub for ExBudget

This commit is contained in:
rvcas 2022-12-08 10:56:53 -05:00
parent f250d3df84
commit 141a9aef30
No known key found for this signature in database
GPG Key ID: C09B64E263F7D68C
1 changed files with 11 additions and 0 deletions

View File

@ -47,6 +47,17 @@ impl Default for ExBudget {
} }
} }
impl std::ops::Sub for ExBudget {
type Output = Self;
fn sub(self, rhs: Self) -> Self::Output {
ExBudget {
mem: self.mem - rhs.mem,
cpu: self.cpu - rhs.cpu,
}
}
}
#[derive(Default)] #[derive(Default)]
pub struct CostModel { pub struct CostModel {
pub machine_costs: MachineCosts, pub machine_costs: MachineCosts,