Trait NodeCache

Source
pub trait NodeCache:
    Send
    + Sync
    + Debug
    + DynClone {
    // Required methods
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        node: &'life1 Node,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn set<'life0, 'life1, 'async_trait>(
        &'life0 self,
        node: &'life1 Node,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn clear<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn name(&self) -> &'static str { ... }
}
Expand description

Caches nodes, typically by their path and hash Recommended to namespace on the storage

For now just bool return value for easy filter

Required Methods§

Source

fn get<'life0, 'life1, 'async_trait>( &'life0 self, node: &'life1 Node, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn set<'life0, 'life1, 'async_trait>( &'life0 self, node: &'life1 Node, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Source

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

Optionally provide a method to clear the cache

Source

fn name(&self) -> &'static str

Trait Implementations§

Source§

impl NodeCache for &dyn NodeCache

Source§

fn get<'life0, 'life1, 'async_trait>( &'life0 self, node: &'life1 Node, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn set<'life0, 'life1, 'async_trait>( &'life0 self, node: &'life1 Node, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

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

Optionally provide a method to clear the cache
Source§

fn name(&self) -> &'static str

Source§

impl NodeCache for Box<dyn NodeCache>

Source§

fn get<'life0, 'life1, 'async_trait>( &'life0 self, node: &'life1 Node, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn set<'life0, 'life1, 'async_trait>( &'life0 self, node: &'life1 Node, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

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

Optionally provide a method to clear the cache
Source§

fn name(&self) -> &'static str

Implementations on Foreign Types§

Source§

impl NodeCache for Box<dyn NodeCache>

Source§

fn get<'life0, 'life1, 'async_trait>( &'life0 self, node: &'life1 Node, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn set<'life0, 'life1, 'async_trait>( &'life0 self, node: &'life1 Node, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

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

Source§

fn name(&self) -> &'static str

Implementors§