pub struct RateRange {
pub min: Decimal,
pub max: Decimal,
pub currency: Option<String>,
}Expand description
Rate range for abstract resource profiles (RFC-0001)
Represents a cost range with min/max bounds and optional currency. Used during early planning when exact rates are unknown.
Fields§
§min: DecimalMinimum rate (best case)
max: DecimalMaximum rate (worst case)
currency: Option<String>Currency (defaults to project currency if not set)
Implementations§
Source§impl RateRange
impl RateRange
Sourcepub fn spread_percent(&self) -> f64
pub fn spread_percent(&self) -> f64
Calculate the spread percentage: (max - min) / expected * 100
Sourcepub fn is_collapsed(&self) -> bool
pub fn is_collapsed(&self) -> bool
Check if this is a collapsed range (min == max)
Sourcepub fn is_inverted(&self) -> bool
pub fn is_inverted(&self) -> bool
Check if the range is inverted (min > max)
Sourcepub fn apply_multiplier(&self, multiplier: f64) -> Self
pub fn apply_multiplier(&self, multiplier: f64) -> Self
Apply a multiplier to the range (for trait composition)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RateRange
impl<'de> Deserialize<'de> for RateRange
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 RateRange
Auto Trait Implementations§
impl Freeze for RateRange
impl RefUnwindSafe for RateRange
impl Send for RateRange
impl Sync for RateRange
impl Unpin for RateRange
impl UnwindSafe for RateRange
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