Skip to main content

Module envelope

Module envelope 

Source
Expand description

The EventEnvelope — the standard wrapper for every persisted event.

Infrastructure metadata (routing, tracing, auditing) lives in the envelope. The business payload is opaque JSON, allowing each domain crate to own its own schema without leaking it into the engine layer.

§Write / read split

  • NewEvent is what the caller submits to EventStore::append. It contains everything the caller knows: context IDs, the typed payload. It intentionally omits event_id, stream_id, sequence_number, and timestamp — the store assigns those atomically during the append.

  • EventEnvelope is what the store returns and persists. It is the complete, immutable record.

Structs§

EventEnvelope
A single persisted event, wrapped in engine-level metadata.
NewEvent
A pending event ready to be appended to a stream.