Skip to main content

dialcache/
lib.rs

1//! DialCache: explicitly enabled, layered caching with runtime rollout,
2//! request coalescing, tracked invalidation, stale recovery and shadow
3//! validation.
4//!
5//! This crate is a port of the TypeScript library. Its portable behavior is
6//! defined by the Quint models under `formal/` and checked by replaying the
7//! same generated histories through the real API.
8
9#![forbid(unsafe_code)]
10#![warn(missing_debug_implementations)]
11#![warn(missing_docs)]
12
13mod blocking;
14pub mod cancel;
15pub mod clock;
16pub mod codec;
17#[cfg(test)]
18mod cpu_tests;
19pub mod datadog;
20mod deadline;
21mod engine;
22pub mod error;
23mod execution;
24mod flight;
25pub mod identity;
26pub mod limits;
27pub mod local;
28pub mod metrics;
29pub mod observe;
30pub mod operation;
31pub mod policy;
32pub mod preview;
33#[cfg(feature = "prometheus")]
34pub mod prometheus;
35pub mod protocol;
36#[cfg(feature = "redis")]
37pub mod redis;
38pub mod remote;
39pub mod runtime;
40mod scope;
41mod shadow;
42mod shadow_log;
43#[cfg(test)]
44mod shadow_log_tests;
45#[cfg(feature = "test-util")]
46pub mod testing;
47mod use_case;
48
49#[cfg(feature = "prometheus")]
50pub use self::prometheus::{CollectorSchema, PrometheusError, PrometheusObserver};
51pub use cancel::CancelToken;
52pub use clock::{Clock, SystemClock};
53pub use codec::{Codec, FromSync, JsonCodec, Payload, SyncCodec};
54pub use datadog::{
55    DatadogError, DatadogObserver, DatadogOptions, DogStatsdClient, ObservationMetricType,
56};
57pub use engine::{
58    CoalescingState, DialCache, DialCacheBuilder, PolicyProvider, ProcessCoalescingState,
59    ScopeGuard,
60};
61pub use error::{BoxError, ConfigError, Error, FallbackTimeout, RemoteReadTimeout, SharedError};
62pub use identity::{normalize_args, ArgValue, Identity, IdentityError, IntoKeyId, Keys};
63pub use local::{LocalEntry, LocalRead, LocalStore, LruLocalStore, StoredValue};
64pub use metrics::MetricKind;
65pub use observe::{
66    Event, Labels, LogEvent, LogLevel, Logger, Observer, ShadowMismatchDetails,
67    ShadowMismatchDiffDetails, ShadowMismatchValueDetails,
68};
69pub use operation::{
70    Comparator, MismatchDiffHook, MismatchEntry, Operation, Preview, RecoveryPredicate,
71    SourceBudget,
72};
73pub use policy::{
74    MismatchDiff, MismatchLogging, Policy, PolicyDefaults, PolicyError, ResolvedPolicy,
75    RuntimePolicy, ShadowPolicy,
76};
77#[cfg(feature = "redis")]
78pub use redis::{
79    invalidation_script_sha1, RedisAdapter, RedisConnection, RedisProtocolError,
80    RedisReadCancelled, INVALIDATION_SCRIPT,
81};
82pub use remote::{
83    Frame, InvalidateRequest, MissReason, ReadContext, ReadRequest, ReadResult, Remote,
84    WriteRequest,
85};
86pub use runtime::Runtime;
87#[cfg(feature = "tokio")]
88pub use runtime::TokioRuntime;
89pub use scope::Scope;
90pub use use_case::{KeySpec, UseCase, UseCaseBuilder};