Skip to main content

Module event_stream

Module event_stream 

Source
Expand description

Schema-driven event stream marshalling and unmarshalling.

Frames are built and read against the shapes’ runtime [Schema]s instead of generated per-shape marshallers: member schemas carry the @eventHeader and @eventPayload traits, and the payload travels through the codec of whichever protocol routing selected. Generated code contributes only the pieces that need shape types — a DeserializableEventStream dispatch per stream union and a SerializableEventError dispatch per error enum — and aliases its *Marshaller/*Unmarshaller types to the generics here.

The event framing follows the AWS event stream contract:

  • a data event carries :message-type: event and :event-type (the Smithy member name),
  • an in-band error carries :message-type: exception and :exception-type,
  • @eventHeader members become message headers, an @eventPayload member becomes the payload (raw bytes for blobs, UTF-8 for strings, codec-encoded otherwise). Without an explicit payload member, non-header members form a codec-encoded payload document,
  • :content-type labels the payload: application/octet-stream and text/plain are fixed by the member’s shape, everything else is the selected protocol’s event stream media type.

Structs§

EventFrame
One received event stream frame together with the protocol capability that decodes it.
EventFrameDeserializer
Reads an event struct from a frame, guided by the struct’s schema.
NoModeledEventErrorMarshaller
The error marshaller of a stream union with no modeled @error members.
SchemaEventErrorMarshaller
Marshals the modeled errors of a schema-mode event stream union into exception frames.
SchemaEventMarshaller
Marshals the events of a schema-mode event stream union into frames.
SchemaEventUnmarshaller
Unmarshals schema-mode event stream frames into a generated stream union.

Enums§

InitialResponsePolicy
Whether to emit an initial response before output events.

Traits§

DeserializableEventStream
A schema-mode event stream union that can be read back from frames.
SerializableEventError
Names the active variant of a generated event stream error enum.

Functions§

apply_initial_request
Applies the initial-request frame, when the protocol carries one, to the operation input being built.
event_stream_response_body
Builds the response body of an event stream output: the marshalled events, preceded by an initial-response frame when initial_response is InitialResponsePolicy::Send.