Expand description
Event types for structured command output
This module defines Event, the structured message type that commands produce and the
Presenter consumes. Events decouple output production from rendering: a command emits events
through Output, and the Presenter decides how to render them based on its output mode and
verbosity settings.
The Artifact trait enables the Event::Artifact variant to carry a type-erased value that
supports both text rendering (Display) and JSON serialization (Serialize). A blanket
implementation covers any type satisfying the required bounds, so command authors derive the
usual traits and pass values to Output without manual trait implementation.
Structs§
- Event
Receiver - Receiver handle for the event channel
- Event
Sender - Sender handle for the event channel
- Send
Error - Error returned when sending an event fails
Enums§
- Event
- Structured output event produced by commands
Traits§
- Artifact
- Trait for artifact values that can be rendered as text or JSON
Functions§
- event_
channel - Creates a bounded event channel