Skip to main content

PersistentMiddleware

Trait PersistentMiddleware 

Source
pub trait PersistentMiddleware: Send + Sync {
    // Required method
    fn handle<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        request: &'life1 Request,
        page: &'life2 PageContext,
    ) -> Pin<Box<dyn Future<Output = Option<Response>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

A guard an application registers once, and an update runs before the component renders.

Required Methods§

Source

fn handle<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, request: &'life1 Request, page: &'life2 PageContext, ) -> Pin<Box<dyn Future<Output = Option<Response>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Returns a response to refuse the update with, or None to let it run.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§