Struct WriteGroup
pub struct WriteGroup { /* private fields */ }Expand description
One write as the store recorded it: the events one append, or one
ingested group with its compensation, wrote together, and the origin’s
guard.
Never empty: it is built from its first event and grown with
push, so a group with no events cannot be written down.
Implementations§
§impl WriteGroup
impl WriteGroup
pub fn new(
first: SequencePosition,
guard: Option<AppendCondition>,
head: ReplicatedEvent,
) -> Self
pub fn new( first: SequencePosition, guard: Option<AppendCondition>, head: ReplicatedEvent, ) -> Self
A group whose lowest local position is first, starting with head,
the event written there.
guard is the condition an ingested group arrived under, and None
for a local append: a local condition is position-relative, which SY-6
makes unreplicable.
pub fn push(&mut self, event: ReplicatedEvent)
pub fn push(&mut self, event: ReplicatedEvent)
Adds the group’s next event, in local position order.
pub const fn first(&self) -> SequencePosition
pub const fn first(&self) -> SequencePosition
The lowest local position among the rows this group wrote: its name, and the cursor a caller resumes above.
pub const fn guard(&self) -> Option<&AppendCondition>
pub const fn guard(&self) -> Option<&AppendCondition>
The condition the group was ingested under, if it arrived with one.
pub fn events(&self) -> &[ReplicatedEvent]
pub fn events(&self) -> &[ReplicatedEvent]
The group’s events, in local position order. Never empty.
pub fn payload_len(&self) -> usize
pub fn payload_len(&self) -> usize
Total payload bytes, as PushBatch::payload_len
counts them.
Trait Implementations§
§impl Clone for WriteGroup
impl Clone for WriteGroup
§impl Debug for WriteGroup
impl Debug for WriteGroup
impl Eq for WriteGroup
§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.