#[non_exhaustive]pub struct StreamEvent {
pub offset: i64,
pub stream: String,
pub key: Option<String>,
pub payload: Vec<u8>,
pub created_at: i64,
}Expand description
A stream event — honker’s shape with one rename (topic →
stream, ADR-015 §3).
#[non_exhaustive] (ADR-017 §3). Offsets are positions in the
stream’s log — immutable, never renumbered; order is global FIFO
under publish sequence. The key is carried metadata only: not a
partitioning instruction, not a dedup key, not an ordering key.
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.offset: i64Position in the stream’s log; immutable.
stream: StringThe stream name.
key: Option<String>The carried key; None unless published keyed.
payload: Vec<u8>Payload bytes — the serde_json serialization of the trait
Value at publish time (ADR-020 §4); decode with
StreamEvent::payload_as.
created_at: i64Unix seconds at publish (the engines’ single clock source).
Implementations§
Source§impl StreamEvent
impl StreamEvent
Sourcepub fn payload_as<T: DeserializeOwned>(&self) -> Result<T>
pub fn payload_as<T: DeserializeOwned>(&self) -> Result<T>
Decode the stored payload bytes into a concrete target type.
The stored bytes are the serde_json serialization of the
publish-time Value (ADR-020 §4); any deserialization failure
is Error::Codec.