Hook

Trait Hook 

Source
pub trait Hook {
    type Output: Captured;
    type Config: Serialize + for<'de> Deserialize<'de>;

    // Required methods
    fn id(&self) -> String;
    fn config(&self) -> &Self::Config;
    fn run(&self, params: &RuntimeParams) -> CapsulaResult<Self::Output>;

    // Provided method
    fn config_as_json(&self) -> Result<Value, Error> { ... }
}

Required Associated Types§

Required Methods§

Source

fn id(&self) -> String

Source

fn config(&self) -> &Self::Config

Source

fn run(&self, params: &RuntimeParams) -> CapsulaResult<Self::Output>

Provided Methods§

Implementors§