pub async fn run(
state: &AppState,
resource: &Resource,
event: HookEvent,
request: &HookRequest,
payload: Value,
) -> Result<Option<Value>, HttpResponse>Expand description
Run the hook bound to event, if the resource declares one.
Returns Ok(None) to carry on unchanged, Ok(Some(value)) when the hook
replaced the payload/response, and Err(response) when it aborted the
request. A declared hook whose function isn’t loaded fails closed with a
500 — silently skipping it would bypass validation.