Skip to main content

EventGroup

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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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

pub const fn new( guard: Option<AppendCondition>, events: Vec<ReplicatedEvent>, ) -> Self

Groups events that were appended together under guard.

Examples found in repository?
examples/two-devices-one-seat/src/scenario.rs (line 363)
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

§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for EventGroup

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for EventGroup

§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

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.

§

fn from(group: WriteGroup) -> Self

Converts to this type from the input type.
§

impl PartialEq for EventGroup

§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
§

impl Serialize for EventGroup

§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl StructuralPartialEq for EventGroup

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.