pub struct InMemoryToolsetCache { /* private fields */ }Expand description
In-memory ToolsetCache backed by a HashMap. Useful for testing and CLI usage.
Implementations§
Trait Implementations§
Source§impl Default for InMemoryToolsetCache
impl Default for InMemoryToolsetCache
Source§impl ToolsetCache for InMemoryToolsetCache
impl ToolsetCache for InMemoryToolsetCache
Source§type Error = CacheError
type Error = CacheError
Error type returned by cache operations.
Source§fn get_cached<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_cached<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Look up a cached value by key.
Source§fn put_cache<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
json: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put_cache<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
json: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Store a value in the cache.
Auto Trait Implementations§
impl Freeze for InMemoryToolsetCache
impl RefUnwindSafe for InMemoryToolsetCache
impl Send for InMemoryToolsetCache
impl Sync for InMemoryToolsetCache
impl Unpin for InMemoryToolsetCache
impl UnsafeUnpin for InMemoryToolsetCache
impl UnwindSafe for InMemoryToolsetCache
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