Trait Member

Source
pub trait Member<'a, R>: Clone + 'a {
    type Value: Operable;

    // Required methods
    fn apply<O: Operator<<Self::Value as Operable>::Base>>(
        &self,
        op: &O,
        data: &R,
    ) -> bool;
    fn accept_visitor<V: MemberVisitor<'a, Self, R, Self::Value>>(
        &self,
        visitor: &mut V,
    );
}
Available on crate feature filter only.
Expand description

A wrapper for a field of Operable type.

A Member is a filterable field of a structure. You will normally generate implementations of Member using the Filterable derive macro for your type. Whereas a Field provides access for nesting, a Member is visible to queries, and will expose a list of supported operators to a MemberVisitor.

Required Associated Types§

Source

type Value: Operable

The type of the member’s data, which must be Operable so that Django filtering queries can be made against it.

Required Methods§

Source

fn apply<O: Operator<<Self::Value as Operable>::Base>>( &self, op: &O, data: &R, ) -> bool

Apply an operator to the given field of data, returning the result.

Source

fn accept_visitor<V: MemberVisitor<'a, 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 an OperatorSet.

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.

Implementors§