Skip to main content

CacheableQuery

Trait CacheableQuery 

Source
pub trait CacheableQuery: Query {
    // Required method
    fn cache_key(&self) -> String;

    // Provided method
    fn cache_ttl(&self) -> Option<u64> { ... }
}
Expand description

Trait for queries that support caching.

Required Methods§

Source

fn cache_key(&self) -> String

Cache key for this query.

Provided Methods§

Source

fn cache_ttl(&self) -> Option<u64>

Time-to-live for cached results in seconds.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§