pub struct Hook {
pub id: String,
pub name: String,
pub description: Option<String>,
pub event: String,
pub action: Action,
pub enabled: bool,
pub tags: Vec<String>,
pub metadata: Value,
pub condition: Option<Condition>,
}Expand description
A hook that triggers on specific events
Hooks are the core building blocks of the hooks system. Each hook is associated with an event type and defines an action to execute when that event occurs.
§Fields
id- Unique identifier for the hook (typically a UUID)name- Human-readable name for the hookdescription- Optional description of what the hook doesevent- Event type that triggers this hook (e.g., “file_saved”, “test_passed”)action- Action to execute when the hook is triggeredenabled- Whether the hook is currently enabledtags- Tags for categorizing and filtering hooksmetadata- Additional metadata stored as JSONcondition- Optional condition that must be met for the hook to execute
Fields§
§id: StringUnique identifier for the hook
name: StringHuman-readable name
description: Option<String>Optional description
event: StringEvent that triggers this hook
action: ActionAction to execute
enabled: boolWhether the hook is enabled
Tags for categorizing hooks
metadata: ValueAdditional metadata
condition: Option<Condition>Optional condition for execution
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Hook
impl<'de> Deserialize<'de> for Hook
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 Hook
impl RefUnwindSafe for Hook
impl Send for Hook
impl Sync for Hook
impl Unpin for Hook
impl UnwindSafe for Hook
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