Struct EventGroup
#[non_exhaustive]pub struct EventGroup {
pub guard: Option<AppendCondition>,
pub events: Vec<ReplicatedEvent>,
}Expand description
Events that one origin-side decision appended together, and the condition it appended them under.
The guard travels as evidence, not as an instruction. It says what the
origin checked before it decided; it is not a condition for the receiver to
re-evaluate against its own log, because the receiver’s log contains events
the origin never saw and re-checking would reject a fact that is already
durable elsewhere. SY-6 settles what it is for: an adjudicator may read it,
and a guard carrying after is refused at ingest. Phase 13 builds the refusal.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.guard: Option<AppendCondition>What the origin checked before appending. Evidence only.
events: Vec<ReplicatedEvent>The events, which must land atomically or not at all.
Implementations§
§impl EventGroup
impl EventGroup
pub const fn new(
guard: Option<AppendCondition>,
events: Vec<ReplicatedEvent>,
) -> Self
pub const fn new( guard: Option<AppendCondition>, events: Vec<ReplicatedEvent>, ) -> Self
Groups events that were appended together under guard.
Examples found in repository?
353 pub async fn judge_again(&self) -> Result<usize, StoryError> {
354 let held = self
355 .central
356 .log(Place::Central)
357 .await?
358 .into_iter()
359 .map(|event| ReplicatedEvent::new(event.id, event.recorded_at, event.event))
360 .collect();
361 let answered = self
362 .rule
363 .compensation(&EventGroup::new(None, held), &[])
364 .await
365 .map_err(StoryError::Adjudicate)?;
366 Ok(answered.len())
367 }Trait Implementations§
§impl Clone for EventGroup
impl Clone for EventGroup
§impl Debug for EventGroup
impl Debug for EventGroup
§impl<'de> Deserialize<'de> for EventGroup
impl<'de> Deserialize<'de> for EventGroup
§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for EventGroup
§impl From<WriteGroup> for EventGroup
The wire shape of a write group: the guard travels as evidence (SY-6), the
events in order. Moves both; nothing is copied.
impl From<WriteGroup> for EventGroup
The wire shape of a write group: the guard travels as evidence (SY-6), the events in order. Moves both; nothing is copied.