pub enum WireEvent<T> {
Known(T),
Unknown {
event_type: String,
value: UnknownPayload,
},
Corrupt(Error),
}Expand description
One classified wire frame.
Variants§
Known(T)
The frame carries a discriminator this client models and its payload decoded fully.
Unknown
Valid JSON whose discriminator this client does not model. Policy (owned by the stream driver, never per adapter): warn — structural metadata only, so payloads never leak into logs — and skip, for forward compatibility.
Fields
value: UnknownPayloadThe full frame payload, for the driver’s raw passthrough channel (never for its warn log — and its Debug is redacted by type).
Corrupt(Error)
Not valid JSON, or a modeled discriminator whose payload failed the
typed decode — a data-level defect in a known event, which must never
be demoted to Unknown.
Implementations§
Source§impl<T> WireEvent<T>
impl<T> WireEvent<T>
Sourcepub fn map<U>(self, f: impl FnOnce(T) -> U) -> WireEvent<U>
pub fn map<U>(self, f: impl FnOnce(T) -> U) -> WireEvent<U>
Map the Known payload, preserving the classification.
This is how an adapter layers a pure event-shape mapping on top of a
classifier without restating the triage: Unknown and Corrupt pass
through untouched, so policy stays with the driver.