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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! Reconstruction-cache contracts and adapters for Shardline.
//!
//! Reconstruction responses can be expensive to compute from large metadata
//! indexes. This crate defines a small async cache boundary keyed by file,
//! content hash, and optional repository scope. The in-memory adapter is useful
//! for single-process deployments; the Redis adapter lets multiple server
//! replicas share cached reconstruction payloads.
//!
//! # Example
//!
//! ```
//! use shardline_cache::ReconstructionCacheKey;
//! use shardline_protocol::{RepositoryProvider, RepositoryScope};
//!
//! let scope =
//! RepositoryScope::new(RepositoryProvider::GitHub, "acme", "assets", Some("main"))?;
//! let latest = ReconstructionCacheKey::latest("file-123", Some(&scope));
//! let immutable = ReconstructionCacheKey::version("file-123", "content-456", Some(&scope));
//!
//! assert_eq!(latest.content_hash(), None);
//! assert_eq!(immutable.content_hash(), Some("content-456"));
//! assert_eq!(latest.repository_scope().unwrap().provider(), "github");
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
pub use DisabledReconstructionCache;
pub use ReconstructionCacheError;
pub use ;
pub use MemoryReconstructionCache;
pub use RedisReconstructionCache;
pub use ;