pub struct EconomicsContextSeed {Show 13 fields
pub seed: String,
pub candidates: u64,
pub candidate_bytes: u64,
pub candidate_tokens: u64,
pub considered: u64,
pub considered_tokens: u64,
pub selected: u64,
pub selected_bytes: u64,
pub selected_tokens: u64,
pub estimated_selected_tokens: u64,
pub excluded_tokens: BTreeMap<String, u64>,
pub unresolved: u64,
pub over_budget: bool,
}Expand description
Token counts of one context-compilation seed.
use majordomus_cli::economics::model::EconomicsContextSeed;
let s: EconomicsContextSeed = serde_json::from_value(serde_json::json!({
"seed": "I0042", "candidates": 12, "candidate_bytes": 44000, "candidate_tokens": 11000,
"considered": 90, "considered_tokens": 160000, "selected": 9, "selected_bytes": 32800,
"selected_tokens": 8200, "estimated_selected_tokens": 8200,
"excluded_tokens": { "budget": 2800 }, "unresolved": 0, "over_budget": false
}))
.unwrap();
assert_eq!(s.selected_tokens + s.excluded_tokens["budget"], s.candidate_tokens);
assert_eq!(s.estimated_selected_tokens, s.selected_bytes / 4, "the compiler's own estimate");Fields§
§seed: StringThe work the compiler was asked about (an issue id).
candidates: u64Distinct files the compiler judged relevant to the work: what it selected, and what it left out only because the budget ran out. The denominator of context reduction.
candidate_bytes: u64Their bytes.
candidate_tokens: u64Their tokens, counted.
considered: u64Distinct files the compiler reached at all, relevant or not.
considered_tokens: u64Their tokens, counted. Never a denominator: most of it the compiler judged irrelevant.
selected: u64Distinct files it selected.
selected_bytes: u64Their bytes.
selected_tokens: u64Their tokens, counted.
estimated_selected_tokens: u64The compiler’s own cost estimate of what it selected (bytes over four).
excluded_tokens: BTreeMap<String, u64>Counted tokens it left out, by the reason it gave.
unresolved: u64Entries naming nothing on disk, which could not be counted.
over_budget: boolWhether the compiler reported its selection over budget.
Trait Implementations§
Source§impl Clone for EconomicsContextSeed
impl Clone for EconomicsContextSeed
Source§fn clone(&self) -> EconomicsContextSeed
fn clone(&self) -> EconomicsContextSeed
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 EconomicsContextSeed
impl Debug for EconomicsContextSeed
Source§impl<'de> Deserialize<'de> for EconomicsContextSeed
impl<'de> Deserialize<'de> for EconomicsContextSeed
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 EconomicsContextSeed
Source§impl JsonSchema for EconomicsContextSeed
impl JsonSchema for EconomicsContextSeed
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 EconomicsContextSeed
impl PartialEq for EconomicsContextSeed
Source§fn eq(&self, other: &EconomicsContextSeed) -> bool
fn eq(&self, other: &EconomicsContextSeed) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for EconomicsContextSeed
impl Serialize for EconomicsContextSeed
impl StructuralPartialEq for EconomicsContextSeed
Auto Trait Implementations§
impl Freeze for EconomicsContextSeed
impl RefUnwindSafe for EconomicsContextSeed
impl Send for EconomicsContextSeed
impl Sync for EconomicsContextSeed
impl Unpin for EconomicsContextSeed
impl UnsafeUnpin for EconomicsContextSeed
impl UnwindSafe for EconomicsContextSeed
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.