Trait Field

Source
pub trait Field<R>: Clone {
    type Value;

    // Required method
    fn apply<O: Operator<Self::Value>>(&self, op: &O, data: &R) -> bool;
}
Available on crate feature filter only.
Expand description

A wrapper for a field of any type.

A Field allows us to apply an Operator to one field of a structure. You will normally generate implementations of Field using the Filterable derive macro for your type. The key use of Field is in traversing nested structures: whereas a Member represents applying an operator to an Operable value, the value of a Field can be arbitrary, and is often a structured type.

Required Associated Types§

Source

type Value

The type an operator on this field must accept.

Required Methods§

Source

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

Apply op to a particular field of data, and return the result.

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§