Skip to main content

ToolsetCache

Trait ToolsetCache 

Source
pub trait ToolsetCache: Send + Sync {
    type Error: Error + Send + Sync + 'static;

    // Required methods
    fn get_cached<'life0, 'life1, 'async_trait>(
        &'life0 self,
        cache_key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<String>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn put_cache<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        cache_key: &'life1 str,
        json: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Abstraction over toolset manifest caching.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Error type returned by cache operations.

Required Methods§

Source

fn get_cached<'life0, 'life1, 'async_trait>( &'life0 self, cache_key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, Self::Error>> + 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, cache_key: &'life1 str, json: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Store a value in the cache.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§