pub struct Attribution { /* private fields */ }Implementations§
Source§impl Attribution
impl Attribution
pub fn new() -> Attribution
Sourcepub fn apply(&mut self, record: &EventRecord) -> Result<(), StorageError>
pub fn apply(&mut self, record: &EventRecord) -> Result<(), StorageError>
Folds one record in. model_returned and cache_renewed move
money; two other kinds set the basis on which the next call is
split, and run_frozen drops the basis of a run that makes no
further call.
Sourcepub fn billed_to(&self, run: &RunId) -> Option<UsdMicros>
pub fn billed_to(&self, run: &RunId) -> Option<UsdMicros>
What run was billed, when this fold holds a row for it: one
lookup rather than a whole report() per question.
Sourcepub fn retain_runs(&mut self, keep: impl Fn(&RunId) -> bool)
pub fn retain_runs(&mut self, keep: impl Fn(&RunId) -> bool)
Drops the by_run row of every run keep refuses. total and
the other four cuts keep the money, so they still sum to total
while by_run shrinks to the runs a caller still holds warm.
pub fn report(&self) -> AttributionReport
Trait Implementations§
Source§impl Clone for Attribution
impl Clone for Attribution
Source§impl Default for Attribution
impl Default for Attribution
Source§impl<'de> Deserialize<'de> for Attribution
impl<'de> Deserialize<'de> for Attribution
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
Auto Trait Implementations§
impl Freeze for Attribution
impl RefUnwindSafe for Attribution
impl Send for Attribution
impl Sync for Attribution
impl Unpin for Attribution
impl UnsafeUnpin for Attribution
impl UnwindSafe for Attribution
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