pub struct ContextLedger {
pub items: Vec<ContextItem>,
pub budget: ContextBudget,
pub diagnostics: Vec<ContextDiagnostic>,
}Expand description
The context ledger: all candidate/selected items, the budget, and diagnostics for a turn.
Fields§
§items: Vec<ContextItem>Every candidate item and its selected, omitted, or blocked state.
budget: ContextBudgetResolved token limits and current budget usage.
diagnostics: Vec<ContextDiagnostic>Diagnostics produced while resolving limits or selecting context.
Implementations§
Source§impl ContextLedger
impl ContextLedger
Sourcepub fn rendered(&self) -> Vec<&ContextItem>
pub fn rendered(&self) -> Vec<&ContextItem>
Items rendered into the prompt this turn.
Sourcepub fn counts(&self) -> ContextCounts
pub fn counts(&self) -> ContextCounts
Count of items by visibility label.
Sourcepub fn find(&self, id: &str) -> Option<&ContextItem>
pub fn find(&self, id: &str) -> Option<&ContextItem>
Find an item by id.
Trait Implementations§
Source§impl Clone for ContextLedger
impl Clone for ContextLedger
Source§fn clone(&self) -> ContextLedger
fn clone(&self) -> ContextLedger
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 ContextLedger
impl Debug for ContextLedger
impl Eq for ContextLedger
Source§impl PartialEq for ContextLedger
impl PartialEq for ContextLedger
impl StructuralPartialEq for ContextLedger
Auto Trait Implementations§
impl Freeze for ContextLedger
impl RefUnwindSafe for ContextLedger
impl Send for ContextLedger
impl Sync for ContextLedger
impl Unpin for ContextLedger
impl UnsafeUnpin for ContextLedger
impl UnwindSafe for ContextLedger
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