Trait django_query::filtering::Member
source · [−]pub trait Member<R>: Clone {
type Value: Operable;
fn apply<O: Operator<<Self::Value as Operable>::Base>>(
&self,
op: &O,
data: &R
) -> bool;
fn accept_visitor<V: MemberVisitor<Self, R, Self::Value>>(
&self,
visitor: &mut V
);
}
Expand description
A wrapper for one field of another type, which has Operable type.
A Member
is an exposed field of a structure. You will normally
generate implementations of Member
using the Filterable derive
macro for your type. Whereas a Field is just about access for
mechanical reasons (nesting), a Member
is visible in queries,
and can expose a list of supported query operators to a
MemberVisitor.
Associated Types
Required methods
Apply an operator to the given field of data
, returning the
result.
fn accept_visitor<V: MemberVisitor<Self, R, Self::Value>>(
&self,
visitor: &mut V
)
fn accept_visitor<V: MemberVisitor<Self, R, Self::Value>>(
&self,
visitor: &mut V
)
visitor
will be called with each of the supported operator
classes for this member. This is used to build up a list
of supported queries in a OperatorSet.