sov_first_read_last_write_cache/
lib.rs1use thiserror::Error;
2
3pub mod cache;
4
5mod access;
6mod utils;
7
8use std::fmt::Display;
9use std::sync::Arc;
10
11pub use access::MergeError;
12
13#[derive(Error, Debug, Eq, PartialEq, Clone, Hash, PartialOrd, Ord)]
14pub struct CacheKey {
15 pub key: Arc<Vec<u8>>,
16}
17
18impl Display for CacheKey {
19 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20 write!(f, "{:?}", self.key)
22 }
23}
24
25#[derive(Error, Debug, Eq, PartialEq, Clone)]
26pub struct CacheValue {
27 pub value: Arc<Vec<u8>>,
28}
29
30impl Display for CacheValue {
31 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
32 write!(f, "{:?}", self.value)
34 }
35}