pub struct StepCost {
pub step_id: String,
pub step_name: String,
pub estimated: Money,
pub actual: Option<Money>,
pub cost_center: Option<String>,
}Expand description
A cost entry for a single workflow step.
Fields§
§step_id: StringStep identifier.
step_name: StringHuman-readable step name.
estimated: MoneyEstimated cost before execution.
actual: Option<Money>Actual cost after execution (None if not yet run).
cost_center: Option<String>Cost center this step is billed to.
Implementations§
Source§impl StepCost
impl StepCost
Sourcepub fn new(step_id: &str, step_name: &str, estimated: Money) -> Self
pub fn new(step_id: &str, step_name: &str, estimated: Money) -> Self
Create a new step cost with an estimate.
Sourcepub fn record_actual(&mut self, actual: Money)
pub fn record_actual(&mut self, actual: Money)
Record the actual cost after the step executes.
Sourcepub fn assign_cost_center(&mut self, center: &str)
pub fn assign_cost_center(&mut self, center: &str)
Assign to a cost center.
Sourcepub fn variance_cents(&self) -> Option<i64>
pub fn variance_cents(&self) -> Option<i64>
Variance between actual and estimated (positive = over-budget).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StepCost
impl RefUnwindSafe for StepCost
impl Send for StepCost
impl Sync for StepCost
impl Unpin for StepCost
impl UnsafeUnpin for StepCost
impl UnwindSafe for StepCost
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