pub struct Spend { /* private fields */ }Expand description
What a run spent, and what it could not price.
Serialisable so an interrupted run can carry its ledger across a stop: a budget bounds a run, and a run that stopped and continued is one run.
Implementations§
Source§impl Spend
impl Spend
Sourcepub fn add(&mut self, model: &str, charge: Charge)
pub fn add(&mut self, model: &str, charge: Charge)
Add a charge, remembering an unpriced call rather than skipping it.
pub fn micros(&self) -> Micros
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Whether every call that happened could be priced.
The question a cost budget’s enforcement depends on: a total that
missed calls is not a total, and reporting it as one would be the
pretending Runtime 0.1 §8 forbids.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Spend
impl<'de> Deserialize<'de> for Spend
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 Eq for Spend
impl StructuralPartialEq for Spend
Auto Trait Implementations§
impl Freeze for Spend
impl RefUnwindSafe for Spend
impl Send for Spend
impl Sync for Spend
impl Unpin for Spend
impl UnsafeUnpin for Spend
impl UnwindSafe for Spend
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