pub trait CachePolicy: Send + Sync + Debug + 'static {
    fn on_create(
        &self,
        inner: Arc<dyn Accessor>,
        cache: Arc<dyn Accessor>,
        path: &str,
        args: OpCreate
    ) -> BoxFuture<'static, Result<RpCreate>> { ... } fn on_read(
        &self,
        inner: Arc<dyn Accessor>,
        cache: Arc<dyn Accessor>,
        path: &str,
        args: OpRead
    ) -> BoxFuture<'static, Result<(RpRead, BytesReader)>> { ... } fn on_write(
        &self,
        inner: Arc<dyn Accessor>,
        cache: Arc<dyn Accessor>,
        path: &str,
        args: OpWrite,
        r: BytesReader
    ) -> BoxFuture<'static, Result<RpWrite>> { ... } fn on_delete(
        &self,
        inner: Arc<dyn Accessor>,
        cache: Arc<dyn Accessor>,
        path: &str,
        args: OpDelete
    ) -> BoxFuture<'static, Result<RpDelete>> { ... } }
Expand description

CachePolicy allows user to specify the policy while caching.

Provided Methods§

on_create returns the cache policy on create operation.

on_read returns the cache policy on read operation.

on_write returns the cache policy on write operation.

on_delete returns the cache policy on delete operation.

Implementations on Foreign Types§

Implementors§