Skip to main content

Module event

Module event 

Source
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§

EventReceiver
Receiver handle for the event channel
EventSender
Sender handle for the event channel
SendError
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