Skip to main content

cache_query_impl

Function cache_query_impl 

Source
pub fn cache_query_impl<const N: usize>(
    c_params: &[DataField; N],
    cache: &mut impl CacheAble<DataField, RowData, N>,
    query_fn: impl FnOnce() -> KnowledgeResult<RowData>,
) -> RowData
Expand description

Generic cache wrapper: fetch from cache by c_params, otherwise run query_fn and save.