Skip to main content

QueryCache

Trait QueryCache 

Source
pub trait QueryCache:
    Send
    + Sync
    + Debug {
    // Required methods
    fn load<'life0, 'life1, 'async_trait>(
        &'life0 self,
        package_name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn save<'life0, 'life1, 'async_trait>(
        &'life0 self,
        package_name: &'life1 str,
        bytes: Bytes,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn remove<'life0, 'life1, 'async_trait>(
        &'life0 self,
        package_name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Persistent storage for serialized registry query responses.

Required Methods§

Source

fn load<'life0, 'life1, 'async_trait>( &'life0 self, package_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Load the serialized cache entry for a package name.

Source

fn save<'life0, 'life1, 'async_trait>( &'life0 self, package_name: &'life1 str, bytes: Bytes, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Persist a serialized cache entry for a package name.

Source

fn remove<'life0, 'life1, 'async_trait>( &'life0 self, package_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remove the cache entry for a package name, if present.

Implementors§