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 not recognized by this classifier. Drivers log structural metadata only and skip interpretation.
Fields
value: UnknownPayloadFull payload for raw passthrough, never warning logs. Debug is redacted.
Corrupt(Error)
Invalid JSON or a recognized frame that failed typed decoding.
Must not be demoted to Unknown.
Implementations§
Source§impl<T> WireEvent<T>
impl<T> WireEvent<T>
Sourcepub fn unrecognized(
event_type: impl Into<String>,
detail: impl Into<String>,
) -> Self
pub fn unrecognized( event_type: impl Into<String>, detail: impl Into<String>, ) -> Self
An event a typed transport (an SDK event stream, a gRPC stream) reported that this client does not model. The detail is kept for raw passthrough, never for warning logs.
Sourcepub fn malformed(message: impl Display) -> Self
pub fn malformed(message: impl Display) -> Self
A modeled event a typed transport failed to decode.
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> 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