Skip to main content

Module hooks

Module hooks 

Source

Traits§

ModelHooks
Optional lifecycle hooks for a Model. All methods have a no-op default — implement only what you need. Returning Err from a before_* hook cancels the operation (no SQL runs); the error reaches the caller as Error::Hook. An after_* error is returned too, but the statement has already run: it is rolled back only if the caller is inside atomic() / a transaction.

Type Aliases§

BoxFuture
HookResult