Skip to main content

fluvio_stream_model/store/
mod.rs

1mod concurrent_hashmap;
2pub mod actions;
3mod metadata;
4mod filter;
5mod dual_store;
6pub mod event;
7
8#[cfg(feature = "k8")]
9pub mod k8;
10
11pub use filter::*;
12pub use concurrent_hashmap::*;
13pub use metadata::*;
14pub use dual_store::*;
15
16// re-export epoch
17pub use crate::epoch::*;
18
19/// simple memory based metadata
20pub mod memory {
21
22    use crate::core::{MetadataItem, MetadataRevExtension};
23
24    /// simple memory representation of meta
25    #[derive(Debug, Default, Eq, PartialEq, Clone)]
26    pub struct MemoryMeta {
27        pub rev: u32,
28    }
29
30    impl MetadataItem for MemoryMeta {
31        type UId = u32;
32
33        fn uid(&self) -> &Self::UId {
34            &self.rev
35        }
36
37        fn is_newer(&self, another: &Self) -> bool {
38            self.rev >= another.rev
39        }
40    }
41
42    impl MetadataRevExtension for MemoryMeta {
43        fn next_rev(&self) -> Self {
44            Self { rev: self.rev + 1 }
45        }
46    }
47
48    impl MemoryMeta {
49        #[allow(unused)]
50        pub fn new(rev: u32) -> Self {
51            Self { rev }
52        }
53    }
54}