Expand description
DialCache: explicitly enabled, layered caching with runtime rollout, request coalescing, tracked invalidation, stale recovery and shadow validation.
This crate is a port of the TypeScript library. Its portable behavior is
defined by the Quint models under formal/ and checked by replaying the
same generated histories through the real API.
Re-exports§
pub use self::prometheus::CollectorSchema;pub use self::prometheus::PrometheusError;pub use self::prometheus::PrometheusObserver;pub use cancel::CancelToken;pub use clock::Clock;pub use clock::SystemClock;pub use codec::Codec;pub use codec::FromSync;pub use codec::JsonCodec;pub use codec::Payload;pub use codec::SyncCodec;pub use datadog::DatadogError;pub use datadog::DatadogObserver;pub use datadog::DatadogOptions;pub use datadog::DogStatsdClient;pub use datadog::ObservationMetricType;pub use error::BoxError;pub use error::ConfigError;pub use error::Error;pub use error::FallbackTimeout;pub use error::RemoteReadTimeout;pub use identity::normalize_args;pub use identity::ArgValue;pub use identity::Identity;pub use identity::IdentityError;pub use identity::IntoKeyId;pub use identity::Keys;pub use local::LocalEntry;pub use local::LocalRead;pub use local::LocalStore;pub use local::LruLocalStore;pub use local::StoredValue;pub use metrics::MetricKind;pub use observe::Event;pub use observe::Labels;pub use observe::LogEvent;pub use observe::LogLevel;pub use observe::Logger;pub use observe::Observer;pub use observe::ShadowMismatchDetails;pub use observe::ShadowMismatchDiffDetails;pub use observe::ShadowMismatchValueDetails;pub use operation::Comparator;pub use operation::MismatchDiffHook;pub use operation::MismatchEntry;pub use operation::Operation;pub use operation::Preview;pub use operation::RecoveryPredicate;pub use operation::SourceBudget;pub use policy::MismatchDiff;pub use policy::MismatchLogging;pub use policy::Policy;pub use policy::PolicyDefaults;pub use policy::PolicyError;pub use policy::ResolvedPolicy;pub use policy::RuntimePolicy;pub use policy::ShadowPolicy;pub use redis::invalidation_script_sha1;pub use redis::RedisAdapter;pub use redis::RedisConnection;pub use redis::RedisProtocolError;pub use redis::RedisReadCancelled;pub use redis::INVALIDATION_SCRIPT;pub use remote::Frame;pub use remote::InvalidateRequest;pub use remote::MissReason;pub use remote::ReadContext;pub use remote::ReadRequest;pub use remote::ReadResult;pub use remote::Remote;pub use remote::WriteRequest;pub use runtime::Runtime;pub use runtime::TokioRuntime;
Modules§
- cancel
- Cooperative cancellation for remote reads.
- clock
- Wall and elapsed clocks.
- codec
- Serialized payloads and value codecs.
- datadog
- Datadog (DogStatsD) metric exporter.
- error
- Public error types.
- identity
- Logical identities, shared cache keys and rollout cohorts.
- limits
- Numeric domains shared by every DialCache implementation.
- local
- Process-local storage.
- metrics
- The shared event-to-metric mapping of the bundled exporters.
- observe
- Backend-neutral diagnostics: metric events and structured log events.
- operation
- Operations: the typed description of one cached call and its erased form.
- policy
- Static operation policy, sparse runtime overlays and per-invocation resolution.
- preview
- Bounded previews and caps for mismatch warnings.
- prometheus
- Prometheus metric exporter (feature
prometheus). - protocol
- The portable wire protocol: frames, envelopes, text conversion and
duration/timestamp domains (W04–W08 in
formal/guides/CONTRACTS.md), and the built-in confirmed-mismatch difference over JSON values. - redis
- Production
Remoteadapter over the [redis] crate. - remote
- The remote (Redis) adapter boundary.
- runtime
- Detached task admission and timers.
- testing
- Deterministic test doubles: a virtual clock and a single-threaded runtime
that runs the cache’s detached work to quiescence on demand (feature
test-util).
Structs§
- Coalescing
State - A point-in-time snapshot of cache-owned coalescing state.
- Dial
Cache - A cache instance: request, process-local and remote layers behind explicit enablement.
- Dial
Cache Builder - Configures a
DialCache. - KeySpec
- The key of one call: the entity id and any secondary dimensions.
- Process
Coalescing State - Exact process-scoped single-flight state of one instance.
- Scope
- A caching scope handle.
- Scope
Guard - Holds the outermost enabled scope open until dropped.
- UseCase
- A registered use case: a typed cached function.
- UseCase
Builder - Builds a registered use case. Finish with
registerforserdeJSON values orregister_customwith an explicit codec and comparator.
Type Aliases§
- Policy
Provider - Resolves a sparse runtime policy overlay once per enabled call.