pub struct BreakEvenCalculator { /* private fields */ }Expand description
Tracks whether MCP schema overhead is justified by proxy compression savings.
Implementations§
Source§impl BreakEvenCalculator
impl BreakEvenCalculator
Sourcepub fn new(schema_overhead_per_turn: u64) -> Self
pub fn new(schema_overhead_per_turn: u64) -> Self
Create with the estimated schema overhead per turn (in tokens). Typical values: 1500 (minimal profile) to 3500 (full profile).
Sourcepub fn record_proxy_savings(&self, tokens: i64)
pub fn record_proxy_savings(&self, tokens: i64)
Record tokens saved by proxy-level compression this turn.
Sourcepub fn record_turn(&self)
pub fn record_turn(&self)
Advance the turn counter. Call once per API request.
Sourcepub fn mark_ctx_tool_used(&self)
pub fn mark_ctx_tool_used(&self)
Mark that the agent has used a ctx_* MCP tool in this session. Once set, MCP is never disabled mid-session.
Sourcepub fn should_enable_mcp(&self) -> bool
pub fn should_enable_mcp(&self) -> bool
Whether MCP tools should be enabled for this session.
Sourcepub fn summary(&self) -> BreakEvenSummary
pub fn summary(&self) -> BreakEvenSummary
Snapshot of the current break-even state.
Sourcepub fn turn_count(&self) -> u64
pub fn turn_count(&self) -> u64
Current turn count.
Auto Trait Implementations§
impl !Freeze for BreakEvenCalculator
impl RefUnwindSafe for BreakEvenCalculator
impl Send for BreakEvenCalculator
impl Sync for BreakEvenCalculator
impl Unpin for BreakEvenCalculator
impl UnsafeUnpin for BreakEvenCalculator
impl UnwindSafe for BreakEvenCalculator
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more