IntoInputValue

Trait IntoInputValue 

Source
pub trait IntoInputValue<S> {
    // Required method
    fn into_input_value(self) -> InputValue<S>;
}
Expand description

Conversion into an InputValue.

This trait exists to work around orphan rules and allow to specify custom efficient conversions whenever some custom ScalarValue is involved (impl IntoInputValue<CustomScalarValue> for ForeignType would work, while impl From<ForeignType> for InputValue<CustomScalarValue> wound not).

This trait is used inside graphql_input_value! macro expansion and implementing it allows to put values of the implementor type there.

Required Methods§

Source

fn into_input_value(self) -> InputValue<S>

Converts this value into an InputValue.

Implementations on Foreign Types§

Source§

impl<S> IntoInputValue<S> for Cow<'_, str>
where for<'a> &'a str: IntoInputValue<S>, String: IntoInputValue<S>,

Source§

impl<S> IntoInputValue<S> for bool
where bool: ToScalarValue<S>,

Source§

impl<S> IntoInputValue<S> for f64
where f64: ToScalarValue<S>,

Source§

impl<S> IntoInputValue<S> for i32
where i32: ToScalarValue<S>,

Source§

impl<S> IntoInputValue<S> for String
where String: Into<S>,

Source§

impl<S: ScalarValue> IntoInputValue<S> for CompactString

Source§

impl<T, S> IntoInputValue<S> for Option<T>
where T: IntoInputValue<S>,

Source§

impl<T, S> IntoInputValue<S> for &T
where T: ToScalarValue<S> + ?Sized,

Implementors§