Skip to main content

cache_manager/
lib.rs

1//! Rust port of `@nestjs/cache-manager`.
2//!
3//! Source baseline: `cache-manager-upstream` package `@nestjs/cache-manager`
4//! 3.1.2. The upstream package wraps npm `cache-manager`, `keyv`, and
5//! `cacheable`; this port uses `moka` for the runtime cache and keeps the Nest
6//! module/provider/decorator/interceptor surface in Rust.
7
8#![allow(non_snake_case, non_camel_case_types)]
9
10pub mod cache_constants;
11pub mod cache_module;
12pub mod cache_module_definition;
13pub mod cache_providers;
14pub mod decorators;
15pub mod interceptors;
16pub mod interfaces;
17
18pub use cache_constants::{
19    CACHE_KEY_METADATA, CACHE_MANAGER, CACHE_MODULE_OPTIONS, CACHE_TTL_METADATA,
20};
21pub use cache_module::{Cache, CacheModule, DynamicModule, Provider, ProviderKind};
22pub use cache_module_definition::{ConfigurableModuleClass, MODULE_OPTIONS_TOKEN};
23pub use cache_providers::{
24    CacheManager, CacheManagerError, CacheValue, Keyv, KeyvStoreAdapter, createCacheManager,
25    isCacheable,
26};
27pub use decorators::{CacheKey, CacheKeyFactory, CacheTTL, CacheTTLFactory};
28pub use interceptors::{
29    CacheInterceptor, CallHandler, ExecutionContext, HttpAdapter, InterceptorResponse, Request,
30    Response,
31};
32pub use interfaces::{
33    CacheManagerOptions, CacheModuleAsyncOptions, CacheModuleOptions, CacheOptions,
34    CacheOptionsFactory,
35};