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
//! Bounded observation of one authoritative table.
//!
//! Mutation is available only through the observed owner. Projections must be
//! deterministic functions of the supplied row and immutable parameters; shared
//! interior mutation of stored values is not an observed edit.
//!
//! A remote full copy is a projection that includes every row. Mutation,
//! publication, and transport admission are distinct boundaries:
//!
//! ```
//! use core::num::{NonZeroU32, NonZeroU64};
//! use pipecircuit::storage::warp_table::{Capacity, WarpTable, WarpTableRow};
//! use pipecircuit::storage::warp_table::observed::{
//! SourceId, ViewId, ViewDefinition, ViewDelivery, ViewAdmission,
//! };
//!
//! #[derive(WarpTableRow)]
//! #[index(primary = u32)]
//! struct Actor { position: u32, private: u32 }
//! struct PublicPosition;
//! impl ViewDefinition<Actor> for PublicPosition {
//! type Value = u32;
//! fn project(&self, row: ActorRef<'_>) -> Option<u32> {
//! Some(*row.position)
//! }
//! }
//!
//! # fn main() -> Result<(), &'static str> {
//! let table = WarpTable::<Actor>::try_new(Capacity::new(NonZeroU32::MIN))
//! .map_err(|_| "table capacity")?;
//! let mut source = table.observe(SourceId::new(NonZeroU64::MIN))
//! .map_err(|_| "observation storage")?;
//! let mut view = source.maintain(ViewId::new(NonZeroU64::MIN), PublicPosition)
//! .map_err(|_| "view storage")?;
//! source.insert_with_id(7, Actor { position: 42, private: 99 })
//! .map_err(|_| "source sequence exhausted")?;
//! view.refresh(&source).map_err(|_| "publication refused")?;
//!
//! let mut subscriber = view.subscribe();
//! let mut scratch = view.delivery_buffer().map_err(|_| "delivery storage")?;
//! view.transmit(&mut subscriber, &mut scratch, |delivery| {
//! match delivery {
//! ViewDelivery::Baseline { through: _, rows } => {
//! // A real carrier encodes or owns these rows before admission.
//! assert_eq!(rows.map(|row| *row.value).collect::<Vec<_>>(), [42]);
//! }
//! ViewDelivery::Changes { .. } | ViewDelivery::Current { .. } => {}
//! }
//! // Nothing was retained by this illustrative carrier. Retry later.
//! Ok::<_, ()>(ViewAdmission::Backpressured)
//! }).map_err(|_| "transport failure")?;
//! assert_eq!(subscriber.admitted_through(), None);
//! # Ok(())
//! # }
//! ```
//!
//! The definition controls disclosure: private fields need never enter the
//! projection, history, or codec. Changing definition parameters explicitly
//! starts a new epoch. The codec must validate its own byte/field bounds and
//! schema version before applying decoded messages to [`ViewReplica`].
//! Each source incarnation and each view definition need distinct identities.
//! These IDs identify continuity, not authentication.
pub use ;
pub use ;
pub use ;
pub use ObservationSelectionError;
pub use ;
pub use ;