pub struct CachedToolDiscovery { /* private fields */ }Expand description
Enhanced tool discovery with caching
Implementations§
Source§impl CachedToolDiscovery
impl CachedToolDiscovery
pub fn new(cache_capacity: usize) -> Self
Sourcepub fn search_tools(
&self,
provider_name: &str,
keyword: &str,
detail_level: DetailLevel,
all_tools: Vec<McpToolInfo>,
) -> Arc<Vec<ToolDiscoveryResult>> ⓘ
pub fn search_tools( &self, provider_name: &str, keyword: &str, detail_level: DetailLevel, all_tools: Vec<McpToolInfo>, ) -> Arc<Vec<ToolDiscoveryResult>> ⓘ
Search for tools with multi-level caching
The keyword is matched fuzzily (prefix, substring, description, and
similarity scoring in perform_search), so the bloom filter
must not screen it: its definitive “no” only holds for exact
membership of inserted tool names, and filtering non-name keywords
here would discard results the fuzzy search would find. Repeated
queries are instead short-circuited by the LRU detailed cache.
Sourcepub fn get_all_tools_cached(
&self,
provider_name: &str,
all_tools: Vec<McpToolInfo>,
) -> Vec<McpToolInfo>
pub fn get_all_tools_cached( &self, provider_name: &str, all_tools: Vec<McpToolInfo>, ) -> Vec<McpToolInfo>
Get all tools for a provider with caching
Sourcepub fn stats(&self) -> ToolCacheStats
pub fn stats(&self) -> ToolCacheStats
Get cache statistics
Auto Trait Implementations§
impl Freeze for CachedToolDiscovery
impl RefUnwindSafe for CachedToolDiscovery
impl Send for CachedToolDiscovery
impl Sync for CachedToolDiscovery
impl Unpin for CachedToolDiscovery
impl UnsafeUnpin for CachedToolDiscovery
impl UnwindSafe for CachedToolDiscovery
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> 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> 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