pub trait Filterable {
type Root: Filterable;
type Query;
type FilterOptions;
type SortField;
type SortDetails;
// Required methods
fn query(
page: Option<u32>,
page_size: Option<u32>,
sort: Option<Vec<Self::SortDetails>>,
filters: Self::FilterOptions,
) -> Self::Query;
fn into_root_query(query: Self::Query) -> <Self::Root as Filterable>::Query;
}Expand description
The types #[derive(Filters)] generates for a root model or a mirror, so
code mirroring it names them through it instead of by name.
Implemented by the derive.
Required Associated Types§
Sourcetype Root: Filterable
type Root: Filterable
The root model of the chain: the model itself for a root model, the mirrored model’s root for a mirror.
Sourcetype Query
type Query
The query: paging, sorting and the filters (a root’s query model, a mirror’s query parameters).
Sourcetype FilterOptions
type FilterOptions
The filter options.
Sourcetype SortDetails
type SortDetails
The sort details: a sort field and its direction.
Required Methods§
Sourcefn query(
page: Option<u32>,
page_size: Option<u32>,
sort: Option<Vec<Self::SortDetails>>,
filters: Self::FilterOptions,
) -> Self::Query
fn query( page: Option<u32>, page_size: Option<u32>, sort: Option<Vec<Self::SortDetails>>, filters: Self::FilterOptions, ) -> Self::Query
Build a query from its parts.
Sourcefn into_root_query(query: Self::Query) -> <Self::Root as Filterable>::Query
fn into_root_query(query: Self::Query) -> <Self::Root as Filterable>::Query
Convert a query along the chain of mirrored models into the root model’s query (the query itself for a root model).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".