pub struct BridgeStatus {
pub engagement: BridgeEngagement,
pub proxy_running: bool,
pub total_requests: u64,
pub tool_count: usize,
}Expand description
Snapshot of the bridge state used to explain gain’s savings numbers.
Fields§
§engagement: BridgeEngagement§proxy_running: bool§total_requests: u64Cumulative LLM requests the proxy has intercepted (within the freshness
window). 0 means the bridge has not seen compressible traffic.
tool_count: usizeNumber of MCP tools the registry exposes — the /lean-ctx tool-count.
Implementations§
Source§impl BridgeStatus
impl BridgeStatus
Sourcepub fn detect() -> Self
pub fn detect() -> Self
Probe the live proxy port and persisted introspection data to determine whether the bridge is engaged. Never panics: every signal degrades to a conservative default (proxy down / 0 requests) on error.
Sourcepub fn summary_line(&self) -> String
pub fn summary_line(&self) -> String
One-line /lean-ctx-style status shown above the savings numbers so the
precondition for savings (bridge connected + tool-count) is always
explicit.
Sourcepub fn zero_savings_reason(&self, tokens_saved: u64) -> Option<String>
pub fn zero_savings_reason(&self, tokens_saved: u64) -> Option<String>
Explanation for a reported 0 saved, distinguishing “bridge off” from a
genuine zero. Returns None when savings are non-zero (no hint needed).
Trait Implementations§
Source§impl Clone for BridgeStatus
impl Clone for BridgeStatus
Source§fn clone(&self) -> BridgeStatus
fn clone(&self) -> BridgeStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BridgeStatus
impl Debug for BridgeStatus
Auto Trait Implementations§
impl Freeze for BridgeStatus
impl RefUnwindSafe for BridgeStatus
impl Send for BridgeStatus
impl Sync for BridgeStatus
impl Unpin for BridgeStatus
impl UnsafeUnpin for BridgeStatus
impl UnwindSafe for BridgeStatus
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
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<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>
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>
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