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 Member
s 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§
Sourcefn 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_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 aMember
wrapping that field.defop
is the defaultOperatorClass
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)
Sourcefn visit_record<F, T, U>(&mut self, name: &str, field: &F, inner_record: &T)
fn visit_record<F, T, U>(&mut self, name: &str, field: &F, inner_record: &T)
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 aField
wrapping that field (note that there are no exposed operators for aField
, and operators are applied to the record type, since there could not be a singleOperable::Base
type.inner_record
is theMeta
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.