pub enum EventCategory {
Lifecycle,
Hil,
Echo,
UserInput,
Output,
Extension {
namespace: String,
kind: String,
},
}Expand description
Event category for subscription-based routing.
Components declare which categories they subscribe to. The EventBus routes messages only to subscribers of the matching category.
Variants§
Lifecycle
System lifecycle events (init, shutdown, pause, resume).
All components implicitly subscribe to this category.
Hil
Human-in-the-Loop approval requests.
Operations: submit, status, list
Echo
Echo component (example/test).
Operations: echo, check
UserInput
User input from IOBridge.
Components subscribe to this category to receive user messages from the interactive console or other input sources.
Payload should contain:
message: The user’s input text (String)
Output
Output events for IO display.
Components emit this category when they want to output results to the user via IOBridge.
Payload should contain:
message: The message to display (String)level: Optional log level (“info”, “warn”, “error”)
Extension
Extension category for plugins.
Use this for custom components that don’t fit built-in categories.
Implementations§
Source§impl EventCategory
impl EventCategory
Sourcepub fn extension(
namespace: impl Into<String>,
kind: impl Into<String>,
) -> EventCategory
pub fn extension( namespace: impl Into<String>, kind: impl Into<String>, ) -> EventCategory
Creates an Extension category.
§Example
use orcs_event::EventCategory;
let cat = EventCategory::extension("my-plugin", "data");
assert!(matches!(cat, EventCategory::Extension { .. }));Sourcepub fn is_lifecycle(&self) -> bool
pub fn is_lifecycle(&self) -> bool
Returns true if this is the Lifecycle category.
Sourcepub fn is_extension(&self) -> bool
pub fn is_extension(&self) -> bool
Returns true if this is an Extension category.
Sourcepub fn is_user_input(&self) -> bool
pub fn is_user_input(&self) -> bool
Returns true if this is the UserInput category.
Trait Implementations§
Source§impl Clone for EventCategory
impl Clone for EventCategory
Source§fn clone(&self) -> EventCategory
fn clone(&self) -> EventCategory
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more