pub struct EventMetadata {
pub description: String,
pub on_trigger: String,
pub on_publish: String,
}Expand description
Metadata for an event topic.
Defines what an event means, enabling auto-derived instructions for hats. When a hat triggers on or publishes an event, this metadata is used to generate appropriate behavior instructions.
Example:
events:
deploy.start:
description: "Deployment has been requested"
on_trigger: "Prepare artifacts, validate config, check dependencies"
on_publish: "Signal that deployment should begin"Fields§
§description: StringBrief description of what this event represents.
on_trigger: StringInstructions for a hat that triggers on (receives) this event. Describes what the hat should do when it receives this event.
on_publish: StringInstructions for a hat that publishes (emits) this event. Describes when/how the hat should emit this event.
Trait Implementations§
Source§impl Clone for EventMetadata
impl Clone for EventMetadata
Source§fn clone(&self) -> EventMetadata
fn clone(&self) -> EventMetadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EventMetadata
impl Debug for EventMetadata
Source§impl Default for EventMetadata
impl Default for EventMetadata
Source§fn default() -> EventMetadata
fn default() -> EventMetadata
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for EventMetadata
impl<'de> Deserialize<'de> for EventMetadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for EventMetadata
impl RefUnwindSafe for EventMetadata
impl Send for EventMetadata
impl Sync for EventMetadata
impl Unpin for EventMetadata
impl UnsafeUnpin for EventMetadata
impl UnwindSafe for EventMetadata
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more