struct McpUsageRuntime {
entries: Vec<McpUsageProjectRuntime>,
source_token_baselines: VecDeque<(McpSourceTokenBaselineKey, usize)>,
}Expand description
Mutable bounded telemetry lifecycles shared by all MCP server clones.
Fields§
§entries: Vec<McpUsageProjectRuntime>Distinct selected-project identities owned by this MCP process.
source_token_baselines: VecDeque<(McpSourceTokenBaselineKey, usize)>Bounded modeled baselines reused without decoding every indexed file per call.
Implementations§
Source§impl McpUsageRuntime
impl McpUsageRuntime
Sourcefn instance_for_binding(
&mut self,
binding: McpUsageProjectBinding,
) -> Option<Arc<Mutex<UsageRuntimeInstance>>>
fn instance_for_binding( &mut self, binding: McpUsageProjectBinding, ) -> Option<Arc<Mutex<UsageRuntimeInstance>>>
Return or create the identity for one selected project binding.
Sourcefn snapshot(&self) -> Vec<McpUsageProjectRuntime>
fn snapshot(&self) -> Vec<McpUsageProjectRuntime>
Clone the bounded project/runtime set before shutdown database I/O.
Sourcefn source_token_baseline(
&self,
key: &McpSourceTokenBaselineKey,
) -> Option<usize>
fn source_token_baseline( &self, key: &McpSourceTokenBaselineKey, ) -> Option<usize>
Return a cached generation-bound broad-source token baseline.
Sourcefn insert_source_token_baseline(
&mut self,
key: McpSourceTokenBaselineKey,
value: usize,
)
fn insert_source_token_baseline( &mut self, key: McpSourceTokenBaselineKey, value: usize, )
Retain one baseline without allowing arbitrary filter keys to grow memory.
Trait Implementations§
Source§impl Debug for McpUsageRuntime
impl Debug for McpUsageRuntime
Source§impl Default for McpUsageRuntime
impl Default for McpUsageRuntime
Source§fn default() -> McpUsageRuntime
fn default() -> McpUsageRuntime
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for McpUsageRuntime
impl RefUnwindSafe for McpUsageRuntime
impl Send for McpUsageRuntime
impl Sync for McpUsageRuntime
impl Unpin for McpUsageRuntime
impl UnwindSafe for McpUsageRuntime
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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