pub struct LifecycleHooksConfig {
pub on_request: Vec<LifecycleHookRef>,
pub pre_validation: Vec<LifecycleHookRef>,
pub pre_handler: Vec<LifecycleHookRef>,
pub on_response: Vec<LifecycleHookRef>,
pub on_error: Vec<LifecycleHookRef>,
}Expand description
Per-route selection of registered lifecycle hooks.
ServerConfig.lifecycle_hooks holds Arc<dyn LifecycleHook> function pointers and is marked
#[serde(skip)] / #[alef(skip)] because closures cannot be serialized or cross the FFI
boundary. A per-route field with that same shape would be invisible to alef, and therefore
invisible to every binding — defeating the purpose of exposing it here. This descriptor
carries LifecycleHookRef entries instead: each one names a registered hook (plus its
declared dependencies and optional config), so a later enforcement phase can resolve those
names against the server’s registered LifecycleHooks and run the matches for this route. The
five fields mirror the five hook phases documented in the tower-middleware-and-lifecycle
project convention (onRequest, preValidation, preHandler, onResponse, onError). ~keep
Fields§
§on_request: Vec<LifecycleHookRef>Hooks to run in the on_request phase
pre_validation: Vec<LifecycleHookRef>Hooks to run in the pre_validation phase
pre_handler: Vec<LifecycleHookRef>Hooks to run in the pre_handler phase
on_response: Vec<LifecycleHookRef>Hooks to run in the on_response phase
on_error: Vec<LifecycleHookRef>Hooks to run in the on_error phase
Trait Implementations§
Source§impl Clone for LifecycleHooksConfig
impl Clone for LifecycleHooksConfig
Source§impl Debug for LifecycleHooksConfig
impl Debug for LifecycleHooksConfig
Source§impl Default for LifecycleHooksConfig
impl Default for LifecycleHooksConfig
Source§impl<'de> Deserialize<'de> for LifecycleHooksConfig
impl<'de> Deserialize<'de> for LifecycleHooksConfig
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>,
impl Eq for LifecycleHooksConfig
Source§impl PartialEq for LifecycleHooksConfig
impl PartialEq for LifecycleHooksConfig
Source§impl Serialize for LifecycleHooksConfig
impl Serialize for LifecycleHooksConfig
impl StructuralPartialEq for LifecycleHooksConfig
Auto Trait Implementations§
impl Freeze for LifecycleHooksConfig
impl RefUnwindSafe for LifecycleHooksConfig
impl Send for LifecycleHooksConfig
impl Sync for LifecycleHooksConfig
impl Unpin for LifecycleHooksConfig
impl UnsafeUnpin for LifecycleHooksConfig
impl UnwindSafe for LifecycleHooksConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.