StatementCacheStrategy

Trait StatementCacheStrategy 

Source
pub trait StatementCacheStrategy<DB, Statement>: Send + 'static
where DB: Backend, StatementCacheKey<DB>: Hash + Eq,
{ // Required methods fn cache_size(&self) -> CacheSize; fn lookup_statement( &mut self, key: StatementCacheKey<DB>, ) -> LookupStatementResult<'_, DB, Statement>; }
Available on crate feature i-implement-a-third-party-backend-and-opt-into-breaking-changes only.
Expand description

Implement this trait, in order to control statement caching.

Required Methods§

Source

fn cache_size(&self) -> CacheSize

Returns which prepared statement cache size is implemented by this trait

Source

fn lookup_statement( &mut self, key: StatementCacheKey<DB>, ) -> LookupStatementResult<'_, DB, Statement>

Returns whether or not the corresponding cache key is already cached

Implementors§

Source§

impl<DB, Statement> StatementCacheStrategy<DB, Statement> for WithCacheStrategy<DB, Statement>
where DB: Backend + 'static, StatementCacheKey<DB>: Hash + Eq, DB::TypeMetadata: Send + Clone, DB::QueryBuilder: Default, Statement: Send + 'static,

Source§

impl<DB, Statement> StatementCacheStrategy<DB, Statement> for WithoutCacheStrategy
where DB: Backend, StatementCacheKey<DB>: Hash + Eq, DB::TypeMetadata: Clone, DB::QueryBuilder: Default, Statement: 'static,