pub trait SortVisitor<'s> {
type Target;
// Required methods
fn visit_sort<F, T, S>(&mut self, name: &str, field: &F, sort: &S)
where F: Field<Self::Target, Value = T> + 's,
S: SorterTypedClass<T> + 's,
<S as SorterTypedClass<T>>::Sorter: 's;
fn visit_key_sort<F, T, M>(
&mut self,
name: &str,
field: &F,
sort_key: &str,
meta: M,
)
where F: Field<Self::Target, Value = T> + 's,
M: Meta<'s, T>;
}
Available on crate feature
sort
only.Expand description
Receive descriptions of the sort orders a type provides.
Each Meta
instance will accept a SortVisitor
and
describe to it the list of sorts it supports, using the provided
methods.
Required Associated Types§
Required Methods§
Sourcefn visit_sort<F, T, S>(&mut self, name: &str, field: &F, sort: &S)where
F: Field<Self::Target, Value = T> + 's,
S: SorterTypedClass<T> + 's,
<S as SorterTypedClass<T>>::Sorter: 's,
fn visit_sort<F, T, S>(&mut self, name: &str, field: &F, sort: &S)where
F: Field<Self::Target, Value = T> + 's,
S: SorterTypedClass<T> + 's,
<S as SorterTypedClass<T>>::Sorter: 's,
Receive a basic sort on a given raw Field
, named name
.
The comparison operator itself is given as sort
.
Sourcefn visit_key_sort<F, T, M>(
&mut self,
name: &str,
field: &F,
sort_key: &str,
meta: M,
)
fn visit_key_sort<F, T, M>( &mut self, name: &str, field: &F, sort_key: &str, meta: M, )
Receive a key sort on a member field which is itself Sortable
.
Here, name
is the name of the sort as usual, field
is the
accessor for the member, and sort_key
is the name of the
sort in the field’s own type which should be used.
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.