pub struct CostRange {
pub min: Decimal,
pub expected: Decimal,
pub max: Decimal,
pub currency: String,
}Expand description
Cost range for scheduled tasks (RFC-0001)
Represents the computed cost range for a task or project based on abstract resource assignments.
Fields§
§min: DecimalMinimum cost (best case)
expected: DecimalExpected cost (based on policy)
max: DecimalMaximum cost (worst case)
currency: StringCurrency
Implementations§
Source§impl CostRange
impl CostRange
Sourcepub fn new(
min: Decimal,
expected: Decimal,
max: Decimal,
currency: impl Into<String>,
) -> Self
pub fn new( min: Decimal, expected: Decimal, max: Decimal, currency: impl Into<String>, ) -> Self
Create a new cost range
Sourcepub fn fixed(amount: Decimal, currency: impl Into<String>) -> Self
pub fn fixed(amount: Decimal, currency: impl Into<String>) -> Self
Create a fixed (zero-spread) cost range
Sourcepub fn spread_percent(&self) -> f64
pub fn spread_percent(&self) -> f64
Calculate the spread percentage: ±((max - min) / 2 / expected) * 100
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CostRange
impl<'de> Deserialize<'de> for CostRange
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for CostRange
Auto Trait Implementations§
impl Freeze for CostRange
impl RefUnwindSafe for CostRange
impl Send for CostRange
impl Sync for CostRange
impl Unpin for CostRange
impl UnwindSafe for CostRange
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