pub trait SgPluginFilter: Send + Sync + 'static {
    // Required methods
    fn init<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        init_dto: &'life1 SgPluginFilterInitDto
    ) -> Pin<Box<dyn Future<Output = TardisResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn destroy<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = TardisResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn req_filter<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
        ctx: SgRoutePluginContext,
        matched_match_inst: Option<&'life2 SgHttpRouteMatchInst>
    ) -> Pin<Box<dyn Future<Output = TardisResult<(bool, SgRoutePluginContext)>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn resp_filter<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
        ctx: SgRoutePluginContext,
        matched_match_inst: Option<&'life2 SgHttpRouteMatchInst>
    ) -> Pin<Box<dyn Future<Output = TardisResult<(bool, SgRoutePluginContext)>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided methods
    fn accept(&self) -> SgPluginFilterAccept { ... }
    fn before_resp_filter_check(&self, ctx: &SgRoutePluginContext) -> bool { ... }
    fn boxed(self) -> BoxSgPluginFilter
       where Self: Sized { ... }
}

Required Methods§

source

fn init<'life0, 'life1, 'async_trait>( &'life0 mut self, init_dto: &'life1 SgPluginFilterInitDto ) -> Pin<Box<dyn Future<Output = TardisResult<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn destroy<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = TardisResult<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source

fn req_filter<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 str, ctx: SgRoutePluginContext, matched_match_inst: Option<&'life2 SgHttpRouteMatchInst> ) -> Pin<Box<dyn Future<Output = TardisResult<(bool, SgRoutePluginContext)>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source

fn resp_filter<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 str, ctx: SgRoutePluginContext, matched_match_inst: Option<&'life2 SgHttpRouteMatchInst> ) -> Pin<Box<dyn Future<Output = TardisResult<(bool, SgRoutePluginContext)>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Provided Methods§

source

fn accept(&self) -> SgPluginFilterAccept

Enable the filter to have a state that determines whether to execute the filter at runtime

source

fn before_resp_filter_check(&self, ctx: &SgRoutePluginContext) -> bool

Whether to filter the response

source

fn boxed(self) -> BoxSgPluginFilterwhere Self: Sized,

Implementors§