pub trait Hook {
type Output;
// Required method
fn run(self, ctx: &mut HookContext) -> Self::Output;
}
Expand description
A trait that is implemented on hooks.
Hooks are defined via the #[hook]
macro. It provides rewrites to
hook invocations and ensures that hooks can only be called at the top-level of a function
component or a hook. Please refer to its documentation on how to implement hooks.
Required Associated Types§
Required Methods§
Sourcefn run(self, ctx: &mut HookContext) -> Self::Output
fn run(self, ctx: &mut HookContext) -> Self::Output
Runs the hook inside current state, returns output upon completion.