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.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for WireEvent<T>
impl<T> !UnwindSafe for WireEvent<T>
impl<T> Freeze for WireEvent<T>where
T: Freeze,
impl<T> Send for WireEvent<T>where
T: Send,
impl<T> Sync for WireEvent<T>where
T: Sync,
impl<T> Unpin for WireEvent<T>where
T: Unpin,
impl<T> UnsafeUnpin for WireEvent<T>where
T: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more