pub struct Event {
pub event_type: String,
pub context: EventContext,
pub timestamp: String,
}Expand description
Event that triggers hooks
Events are emitted by the system when something happens (e.g., file saved, test passed). Each event has a type, context, and timestamp.
§Examples
ⓘ
Event {
event_type: "file_saved".to_string(),
context: EventContext {
data: json!({
"file_path": "/path/to/file.rs",
"size": 1024,
}),
metadata: json!({
"user": "alice",
"project": "my-project",
}),
},
timestamp: "2024-01-01T12:00:00Z".to_string(),
}Fields§
§event_type: StringEvent type (e.g., “file_saved”, “test_passed”)
context: EventContextEvent context with data and metadata
timestamp: StringEvent timestamp (ISO 8601 format)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
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 Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
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