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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
//! # Sassi
//!
//! Typed in-memory pool (`Punnu<T>`) with composable predicate algebra
//! (`BasicPredicate<T>` + `MemQ<T>`) and cross-runtime trait queries.
//!
//! Sassi is framework-neutral: usable from native services, workers,
//! libraries, and `wasm32-unknown-unknown` applications without a
//! backend-specific dependency. Predicates compose with `&`, `|`, `^`,
//! `!` operators and evaluate through the same in-memory path on every
//! supported target.
//!
//! Pre-v0.1.0 beta. The core public surface is available now:
//! [`Cacheable`] identities, [`Punnu<T>`](Punnu) pools, in-memory
//! [`MemQ`] scopes, lazy fetch helpers, TTL/LRU policy, event streams,
//! and atomic delta application.
//!
//! # Quick tour
//!
//! ```
//! use sassi::{Cacheable, Field, MemQ, Punnu};
//!
//! #[derive(Clone)]
//! struct User { id: i64, age: u32 }
//!
//! #[derive(Default)]
//! struct UserFields {
//! pub id: Field<User, i64>,
//! pub age: Field<User, u32>,
//! }
//!
//! impl Cacheable for User {
//! type Id = i64;
//! type Fields = UserFields;
//!
//! fn id(&self) -> i64 { self.id }
//!
//! fn fields() -> UserFields {
//! UserFields {
//! id: Field::new("id", |u| &u.id),
//! age: Field::new("age", |u| &u.age),
//! }
//! }
//! }
//!
//! # let rt = tokio::runtime::Builder::new_current_thread().build().unwrap();
//! # rt.block_on(async {
//! let users = Punnu::<User>::builder().build();
//! users.insert(User { id: 1, age: 32 }).await.unwrap();
//!
//! let adults = users
//! .scope(vec![MemQ::filter_basic(User::fields().age.gte(18))])
//! .collect();
//! assert_eq!(adults.len(), 1);
//! # });
//! ```
pub
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use PunnuRestoreStats;
pub use ;
pub use Sassi;
pub use Instant;
pub use ;
// Derive macro re-export. The trait and the derive share the name
// `Cacheable` (different namespaces — type namespace for the trait,
// macro namespace for the derive); this matches the standard pattern
// used by stdlib `Clone`, `Debug`, etc.
pub use ;
/// Implementation details used by sassi's proc macros.
///
/// This module is not part of the stable public API. Macro expansion
/// paths are routed through it so generated code does not depend on
/// private module layout.
/// The crate version, surfaced from `CARGO_PKG_VERSION`. Useful for
/// runtime diagnostics. Sassi's binary wire container uses its own
/// `wire::WIRE_FORMAT_MAJOR`, not the crate semver version.