Trait spacegate_kernel::plugins::filters::SgPluginFilter
source · 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§
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§
sourcefn accept(&self) -> SgPluginFilterAccept
fn accept(&self) -> SgPluginFilterAccept
Enable the filter to have a state that determines whether to execute the filter at runtime
sourcefn before_resp_filter_check(&self, ctx: &SgRoutePluginContext) -> bool
fn before_resp_filter_check(&self, ctx: &SgRoutePluginContext) -> bool
Whether to filter the response