pub struct HatConfig {
pub name: String,
pub description: Option<String>,
pub triggers: Vec<String>,
pub publishes: Vec<String>,
pub instructions: String,
pub backend: Option<HatBackend>,
pub default_publishes: Option<String>,
}Expand description
Configuration for a single hat.
Fields§
§name: StringHuman-readable name for the hat.
description: Option<String>Short description of the hat’s purpose (required). Used in the HATS table to help Ralph understand when to delegate to this hat.
triggers: Vec<String>Events that trigger this hat to be worn. Per spec: “Hats define triggers — which events cause Ralph to wear this hat.”
publishes: Vec<String>Topics this hat publishes.
instructions: StringInstructions prepended to prompts.
backend: Option<HatBackend>Backend to use for this hat (inherits from cli.backend if not specified).
default_publishes: Option<String>Default event to publish if hat forgets to write an event.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for HatConfig
impl<'de> Deserialize<'de> for HatConfig
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 HatConfig
impl RefUnwindSafe for HatConfig
impl Send for HatConfig
impl Sync for HatConfig
impl Unpin for HatConfig
impl UnsafeUnpin for HatConfig
impl UnwindSafe for HatConfig
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