pub fn filters<C: Conventions>(input: TokenStream) -> TokenStreamExpand description
#[derive(Filters)]: the filtering, sorting and paging types of a struct,
from its #[filter(lt|eq|gt|sw|c|ew|bool)] and #[sortable] fields.
The struct is either:
- a root model (no
#[filters(mirrors = ...)]): it gets the query, filter-options, sort-field and sort-details models handing filters and sorting to the persistence layer as data, and publishes them throughqueryweave::Filterable; - a mirror of a model (
#[filters(mirrors = path)], e.g. an API DTO): it gets its own sort types and query parameters, converting into the mirrored model’s types. A plain mirror names only the core runtime; the flags#[filters(mirrors = path, serde, utoipa, validator)]opt into deserializable query parameters (and aPageDtoalias), API documentation schemas and validation (which needsserde), andschemarsandgardeinto their alternatives (JSON schemas, validation needing no serializer), each needing only its own crate. A field named differently on the mirrored model maps onto it with#[equivalent_field(name)]; the query parameters keep the mirror’s names. The mirrored model is a root model or another mirror (e.g. a gRPC DTO mirroring an API DTO): a mirror publishes its own types throughqueryweave::Filterabletoo, every chain ending at a root model, andqueryweave::IntoRootQueryconverts a query straight into the root’s.
Attributes: filter, sortable, filters, equivalent_field.