1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! Service pattern integration for cache backends.
//!
//! This crate provides [`ServiceAdapter`] to convert any `Service<CacheOperation>` into
//! a [`CacheTier`](cachet_tier::CacheTier), enabling service middleware composition
//! (retry, timeout, circuit breaker) for cache storage backends.
//!
//! # Overview
//!
//! The adapter provides bidirectional integration:
//! - **Service → Cache**: Use [`ServiceAdapter`] to wrap services as cache tiers
//! - **Cache → Service**: The main `cachet::Cache` implements `Service<CacheOperation>`
//!
//! # Quick Start
//!
//! ```ignore
//! // Any Service<CacheOperation> can become a cache tier
//! let tier = ServiceAdapter::new(my_service);
//! ```
//!
//! # Use Cases
//!
//! - **Remote caches**: Wrap Redis, Memcached, or custom services as cache tiers
//! - **Middleware composition**: Add retry, timeout, or circuit breaker before caching
//! - **Unified abstractions**: Use the same service patterns for caching and other I/O
pub use ServiceAdapter;
pub use CacheServiceExt;
pub use ;