pub struct MaterializedPositions { /* private fields */ }Expand description
Trait for an append-only message store with G-Set CRDT semantics (REQ-300). Trait for an append-only message store with G-Set CRDT semantics (REQ-300). Trait for an append-only message store with G-Set CRDT semantics (REQ-300). Native-computed position cache. Facts have private fields and no deserialize implementation. This is an accepted-evidence port, not authentication itself.
Implementations§
Source§impl MaterializedPositions
impl MaterializedPositions
pub fn new( context: PositionContext, protocol: Option<&CausalProtocol>, ) -> Result<Self, String>
pub fn context(&self) -> &PositionContext
pub fn protocol(&self) -> Option<&CausalProtocol>
pub fn metadata(&self) -> impl DoubleEndedIterator<Item = &PositionMetadata>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn contains(&self, id: &str) -> bool
pub fn progress(&self, verb: &str) -> usize
Sourcepub fn apply_accepted(&mut self, message: &Message) -> Result<(), String>
pub fn apply_accepted(&mut self, message: &Message) -> Result<(), String>
Called after native signature/context/admission checks. Requires exact native identity and thread, and computes positions with the native R5 evaluator. No full message is retained.
Sourcepub fn apply_accepted_with_id(
&mut self,
message: &Message,
id: String,
) -> Result<(), String>
pub fn apply_accepted_with_id( &mut self, message: &Message, id: String, ) -> Result<(), String>
Apply an accepted message under its authenticated state identity. This differs from the simple-message hash only for sealed role roots.
Sourcepub fn restore_attested(
context: PositionContext,
protocol: Option<&CausalProtocol>,
records: Vec<PositionMetadata>,
) -> Result<Self, String>
pub fn restore_attested( context: PositionContext, protocol: Option<&CausalProtocol>, records: Vec<PositionMetadata>, ) -> Result<Self, String>
Restore externally authenticated accepted metadata, never arbitrary claimed positions. Hosts must verify snapshot truth/scope before calling; checkpoint’s safe wrapper performs that verification. Native relation is recomputed here, so even an attested rank cannot override R5.