Trait quilkin::filters::prelude::FilterFactory [−][src]
pub trait FilterFactory: Sync + Send { fn name(&self) -> &'static str; fn create_filter(
&self,
args: CreateFilterArgs<'_>
) -> Result<FilterInstance, Error>; fn require_config<'a, 'b>(
&'a self,
config: Option<ConfigType<'b>>
) -> Result<ConfigType<'b>, Error> { ... } }
Expand description
Provides the name and creation function for a given Filter
.
Required methods
name returns the configuration name for the Filter
The returned string identifies the filter item’s path with the following format:
quilkin.extensions.filters.<module>.<version>.<item-name>
where:
v1alpha1
version of the debug filter has the name:
quilkin.extensions.filters.debug_filter.v1alpha1.Debug
fn create_filter(
&self,
args: CreateFilterArgs<'_>
) -> Result<FilterInstance, Error>
[src]
fn create_filter(
&self,
args: CreateFilterArgs<'_>
) -> Result<FilterInstance, Error>
[src]Returns a filter based on the provided arguments.
Provided methods
fn require_config<'a, 'b>(
&'a self,
config: Option<ConfigType<'b>>
) -> Result<ConfigType<'b>, Error>
[src]
fn require_config<'a, 'b>(
&'a self,
config: Option<ConfigType<'b>>
) -> Result<ConfigType<'b>, Error>
[src]Returns the ConfigType
from the provided Option, otherwise it returns
Error::MissingConfig if the Option is None.