Skip to main content

RelationCache

Trait RelationCache 

Source
pub trait RelationCache:
    Send
    + Sync
    + Debug {
    // Required methods
    fn get_by_id<'life0, 'async_trait>(
        &'life0 self,
        relation_id: RelationId,
    ) -> Pin<Box<dyn Future<Output = Option<RelationDefinition>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_by_key<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 RelationKey,
    ) -> Pin<Box<dyn Future<Output = Option<RelationDefinition>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn store<'life0, 'life1, 'async_trait>(
        &'life0 self,
        relation: &'life1 RelationDefinition,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn remove_by_id<'life0, 'async_trait>(
        &'life0 self,
        relation_id: RelationId,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Adapter for relation definition caching.

Required Methods§

Source

fn get_by_id<'life0, 'async_trait>( &'life0 self, relation_id: RelationId, ) -> Pin<Box<dyn Future<Output = Option<RelationDefinition>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Gets a cached relation by stable id.

Source

fn get_by_key<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 RelationKey, ) -> Pin<Box<dyn Future<Output = Option<RelationDefinition>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Gets a cached relation by natural relation key.

Source

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

Stores or refreshes a relation definition.

Source

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

Removes cached entries for a relation id.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§