pub struct TokenAccounting {
pub bytes_per_token: u64,
pub margin_percent: u32,
pub budget_tokens: u32,
pub used_tokens: u32,
}Expand description
The accounting an assembly was packed under, journaled with it: the estimate rule (bytes per token and margin), the budget, and how much of it the assembly used. Recorded — not recomputed — so an auditor reads the accounting the read actually applied.
Fields§
§bytes_per_token: u64The estimate’s divisor (TOKEN_BYTES_PER_ESTIMATE): estimated
tokens are serialized content bytes divided by this.
margin_percent: u32The safety margin that was applied, in percent.
budget_tokens: u32The budget the assembly was packed against, in estimated tokens.
used_tokens: u32The estimated tokens the packed records sum to.
Trait Implementations§
Source§impl Clone for TokenAccounting
impl Clone for TokenAccounting
Source§fn clone(&self) -> TokenAccounting
fn clone(&self) -> TokenAccounting
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 TokenAccounting
impl Debug for TokenAccounting
Source§impl<'de> Deserialize<'de> for TokenAccounting
impl<'de> Deserialize<'de> for TokenAccounting
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 TokenAccounting
Source§impl PartialEq for TokenAccounting
impl PartialEq for TokenAccounting
Source§impl Serialize for TokenAccounting
impl Serialize for TokenAccounting
impl StructuralPartialEq for TokenAccounting
Auto Trait Implementations§
impl Freeze for TokenAccounting
impl RefUnwindSafe for TokenAccounting
impl Send for TokenAccounting
impl Sync for TokenAccounting
impl Unpin for TokenAccounting
impl UnsafeUnpin for TokenAccounting
impl UnwindSafe for TokenAccounting
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