pub trait FilterParameters<'a>:
Sized
+ FilterParametersReflection
+ Debug
+ Display {
type EvaluatedFilterParameters;
// Required methods
fn from_args(args: FilterArguments<'_>) -> Result<Self>;
fn evaluate(
&'a self,
context: &'a Context<'_>,
) -> Result<Self::EvaluatedFilterParameters>;
}
Expand description
A trait that declares and holds the parameters of a filter.
Provides from_args
, to construct itself from FilterArguments
(parses the arguments)
and evaluate
, to construct its evaluated counterpart (evaluates the arguments).
§Deriving
The whole point of this structure is to facilitate the process of deriving a filter.
Thus, this trait and all traits it requires may be derived with #[derive(Debug, FilterParameters)]
.
See documentation for FilterParameters
macro on liquid-derive
for more information.
Required Associated Types§
Required Methods§
fn from_args(args: FilterArguments<'_>) -> Result<Self>
fn evaluate( &'a self, context: &'a Context<'_>, ) -> Result<Self::EvaluatedFilterParameters>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.