pub trait EventType {
// Required method
fn event_type(&self) -> &'static str;
}Expand description
Returns the type wire-tag string for a realtime event variant — useful
for logging, error messages, and metric labels that need a stable name
without reserializing the value.
async-openai ships an equivalent crate::traits::EventType trait, but it
is gated on the _api feature, which pulls reqwest / tokio / secrecy /
eventsource-stream into the build. dynamo-protocols is types-only by
design (see the Cargo.toml banner), so we mirror the trait shape locally.
If _api ever becomes affordable for this crate, swap pub use async_openai::traits::EventType; in here and remove the impls below; call
sites need no changes.
Implemented today only for RealtimeClientEvent. The RealtimeServerEvent
impl can be added when a consumer needs it.
[NOTE] Could be replaced with a serde-introspection helper (e.g. the
serde_variant crate) that reads the wire tag from #[serde(rename)]
at runtime; deferred until as clean up work.
Required Methods§
fn event_type(&self) -> &'static str
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".