[][src]Derive Macro liquid_derive::FilterReflection

#[derive(FilterReflection)]
{
    // Attributes available to this derive:
    #[filter]
}

Implements FilterReflection for a structure that intends to implement the ParseFilter trait.

Requires the #[filter(...)] attribute to define the filter, with the following information: - name -> the name of the filter - description -> the description of the filter - parameters -> (OPTIONAL) only required if the filter has parameters, the FilterParameters struct

Example

This example is not tested
#[derive(Clone, ParseFilter, FilterReflection)]
#[filter(
    name = "slice",
    description = "Takes a slice of a given string or array.",
    parameters(SliceArgs), // The filter has parameters
    parsed(SliceFilter) // Required by `ParseFilter`, not `FilterReflection`
)]
pub struct Slice;