pub trait InnerFilter: Sized + Nameable {
type Context;
const FIELD_COUNT: usize;
// Required methods
fn from_inner_input_value(
v: IndexMap<&str, &InputValue<WundergraphScalarValue>>,
) -> Option<Self>;
fn from_inner_look_ahead(
v: &[(&str, LookAheadValue<'_, WundergraphScalarValue>)],
) -> Self;
fn to_inner_input_value(
&self,
v: &mut IndexMap<&str, InputValue<WundergraphScalarValue>>,
);
fn register_fields<'r>(
info: &NameBuilder<Self>,
registry: &mut Registry<'r, WundergraphScalarValue>,
) -> Vec<Argument<'r, WundergraphScalarValue>>;
}Expand description
A trait marking that some type is part of a filter
The main objective of this trait is to allow adding a new filter type without implementing multiple traits.
Required Associated Constants§
Sourceconst FIELD_COUNT: usize
const FIELD_COUNT: usize
The number of fields created by this filter
Required Associated Types§
Required Methods§
Sourcefn from_inner_input_value(
v: IndexMap<&str, &InputValue<WundergraphScalarValue>>,
) -> Option<Self>
fn from_inner_input_value( v: IndexMap<&str, &InputValue<WundergraphScalarValue>>, ) -> Option<Self>
Create the given filter from a graphql input value
Sourcefn from_inner_look_ahead(
v: &[(&str, LookAheadValue<'_, WundergraphScalarValue>)],
) -> Self
fn from_inner_look_ahead( v: &[(&str, LookAheadValue<'_, WundergraphScalarValue>)], ) -> Self
Create the given filter from a graphql lookahead value
Sourcefn to_inner_input_value(
&self,
v: &mut IndexMap<&str, InputValue<WundergraphScalarValue>>,
)
fn to_inner_input_value( &self, v: &mut IndexMap<&str, InputValue<WundergraphScalarValue>>, )
Covert the given filter into a graphql value
Sourcefn register_fields<'r>(
info: &NameBuilder<Self>,
registry: &mut Registry<'r, WundergraphScalarValue>,
) -> Vec<Argument<'r, WundergraphScalarValue>>
fn register_fields<'r>( info: &NameBuilder<Self>, registry: &mut Registry<'r, WundergraphScalarValue>, ) -> Vec<Argument<'r, WundergraphScalarValue>>
Register all fields of the the filter in a given graphql schema
This method should register exactly FIELD_COUNT new fields
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.