pub struct MeteringCorrection {
pub id: MeteringCorrectionId,
pub run_id: RunId,
pub operation: String,
pub expected_revision: u64,
pub prompt_tokens: u64,
pub completion_tokens: u64,
pub cost_units: u64,
pub metering: MeteringDetails,
pub reason: String,
}Expand description
Privileged report that replaces the derived measurement, never its original event.
Fields§
§id: MeteringCorrectionIdStable idempotency identity, unique within the Session.
run_id: RunIdTerminal Run whose measurement is corrected.
operation: StringOriginal stable operation identity.
expected_revision: u64Exact measurement revision the reporter observed.
prompt_tokens: u64Corrected prompt tokens.
completion_tokens: u64Corrected completion tokens.
cost_units: u64Corrected resource units; no monetary meaning in Factory.
metering: MeteringDetailsReported attribution, preserving the original operation identity.
reason: StringShort audit reason, without credentials or provider response bodies.
Implementations§
Source§impl MeteringCorrection
impl MeteringCorrection
Sourcepub fn validate(&self) -> Result<(), EventError>
pub fn validate(&self) -> Result<(), EventError>
Validate bounded, non-overflowing reported measurements before any write.
Trait Implementations§
Source§impl Clone for MeteringCorrection
impl Clone for MeteringCorrection
Source§fn clone(&self) -> MeteringCorrection
fn clone(&self) -> MeteringCorrection
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MeteringCorrection
impl Debug for MeteringCorrection
Source§impl<'de> Deserialize<'de> for MeteringCorrection
impl<'de> Deserialize<'de> for MeteringCorrection
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 MeteringCorrection
Source§impl PartialEq for MeteringCorrection
impl PartialEq for MeteringCorrection
Source§impl Serialize for MeteringCorrection
impl Serialize for MeteringCorrection
impl StructuralPartialEq for MeteringCorrection
Auto Trait Implementations§
impl Freeze for MeteringCorrection
impl RefUnwindSafe for MeteringCorrection
impl Send for MeteringCorrection
impl Sync for MeteringCorrection
impl Unpin for MeteringCorrection
impl UnsafeUnpin for MeteringCorrection
impl UnwindSafe for MeteringCorrection
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