Trait MetaVisitor

Source
pub trait MetaVisitor<'a, R> {
    // Required methods
    fn visit_member<F, O, T>(&mut self, name: &str, member: &F, defop: O)
       where F: Member<'a, R, Value = T> + Clone,
             O: OperatorClass<<T as Operable>::Base>,
             <O as OperatorClass<<T as Operable>::Base>>::Instance: 'a,
             T: Operable;
    fn visit_record<F, T, U>(&mut self, name: &str, field: &F, inner_record: &T)
       where F: Field<R, Value = U> + Clone + 'a,
             T: Meta<'a, U>;
}
Available on crate feature filter only.
Expand description

Receive descriptions of the Members a type contains from its Meta.

A MetaVisitor can be passed to accept_visitor on Meta to receive a callback for each of the filterable members of a type.

Required Methods§

Source

fn visit_member<F, O, T>(&mut self, name: &str, member: &F, defop: O)
where F: Member<'a, R, Value = T> + Clone, O: OperatorClass<<T as Operable>::Base>, <O as OperatorClass<<T as Operable>::Base>>::Instance: 'a, T: Operable,

This will be called by a Meta instance for each filterable structure member which is Operable. Here:

  • name is the name of the membner, as exposed.
  • member is a Member wrapping that field.
  • defop is the default OperatorClass for that member, which should be applied when no operator is specified (i.e. in the "record__field" case as opposed to the "record__field__op" case)
Source

fn visit_record<F, T, U>(&mut self, name: &str, field: &F, inner_record: &T)
where F: Field<R, Value = U> + Clone + 'a, T: Meta<'a, U>,

This will be called by a Meta instance for each filterable structure field that can be traversed. This is true when the field’s type is itself a structured type, and is not directly filterable. Here:

  • name is the name of the field, as exposed.
  • field is a Field wrapping that field (note that there are no exposed operators for a Field, and operators are applied to the record type, since there could not be a single Operable::Base type.
  • inner_record is the Meta for the field.

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§