Skip to main content

InnerFilter

Trait InnerFilter 

Source
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§

Source

const FIELD_COUNT: usize

The number of fields created by this filter

Required Associated Types§

Source

type Context

The used context type

Required Methods§

Source

fn from_inner_input_value( v: IndexMap<&str, &InputValue<WundergraphScalarValue>>, ) -> Option<Self>

Create the given filter from a graphql input value

Source

fn from_inner_look_ahead( v: &[(&str, LookAheadValue<'_, WundergraphScalarValue>)], ) -> Self

Create the given filter from a graphql lookahead value

Source

fn to_inner_input_value( &self, v: &mut IndexMap<&str, InputValue<WundergraphScalarValue>>, )

Covert the given filter into a graphql value

Source

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.

Implementations on Foreign Types§

Source§

impl InnerFilter for ()

Source§

impl<C> InnerFilter for Option<IsNull<C>>

Implementors§