pub struct EconomicsContextView {
pub revision: String,
pub measured_at: String,
pub tokenizer: EconomicsTokenizer,
pub seeds: usize,
pub candidate_tokens: u64,
pub considered_tokens: u64,
pub selected_tokens: u64,
pub estimated_selected_tokens: u64,
pub excluded_tokens: BTreeMap<String, u64>,
pub seeds_over_budget_counted: usize,
pub budget_tokens: u64,
}Expand description
The context suite’s latest measurement, in brief.
use std::collections::BTreeMap;
use majordomus_cli::economics::model::{EconomicsContextView, EconomicsTokenizer};
let v = EconomicsContextView {
revision: "8d37d011ef".into(), measured_at: "2026-09-24T10:00:00Z".into(),
tokenizer: EconomicsTokenizer {
encoding: "o200k_base".into(), implementation: "tiktoken-rs 0.12.0".into(),
},
seeds: 2, candidate_tokens: 20_000, considered_tokens: 300_000, selected_tokens: 15_000,
estimated_selected_tokens: 16_000,
excluded_tokens: BTreeMap::from([("budget".into(), 5_000)]),
seeds_over_budget_counted: 0, budget_tokens: 8_000,
};
assert_eq!(v.selected_tokens + v.excluded_tokens["budget"], v.candidate_tokens);
assert_eq!(serde_json::to_value(&v).unwrap()["tokenizer"]["encoding"], "o200k_base");Fields§
§revision: StringThe revision measured.
measured_at: StringWhen.
tokenizer: EconomicsTokenizerThe tokenizer.
seeds: usizeSeeds measured.
candidate_tokens: u64Counted candidate tokens (relevant: selected or cut by the budget), all seeds.
considered_tokens: u64Counted tokens of everything the compiler reached, all seeds.
selected_tokens: u64Counted selected tokens, all seeds.
estimated_selected_tokens: u64The compiler’s own estimate of the selected tokens, all seeds.
excluded_tokens: BTreeMap<String, u64>Counted tokens left out, by reason, all seeds.
seeds_over_budget_counted: usizeSeeds whose counted selection exceeds the compiler’s budget.
budget_tokens: u64The compiler’s budget.
Trait Implementations§
Source§impl Clone for EconomicsContextView
impl Clone for EconomicsContextView
Source§fn clone(&self) -> EconomicsContextView
fn clone(&self) -> EconomicsContextView
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 EconomicsContextView
impl Debug for EconomicsContextView
Source§impl<'de> Deserialize<'de> for EconomicsContextView
impl<'de> Deserialize<'de> for EconomicsContextView
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
Source§impl JsonSchema for EconomicsContextView
impl JsonSchema for EconomicsContextView
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for EconomicsContextView
impl PartialEq for EconomicsContextView
Source§fn eq(&self, other: &EconomicsContextView) -> bool
fn eq(&self, other: &EconomicsContextView) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for EconomicsContextView
impl Serialize for EconomicsContextView
impl StructuralPartialEq for EconomicsContextView
Auto Trait Implementations§
impl Freeze for EconomicsContextView
impl RefUnwindSafe for EconomicsContextView
impl Send for EconomicsContextView
impl Sync for EconomicsContextView
impl Unpin for EconomicsContextView
impl UnsafeUnpin for EconomicsContextView
impl UnwindSafe for EconomicsContextView
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