IntoValue

Trait IntoValue 

Source
pub trait IntoValue<S> {
    // Required method
    fn into_value(self) -> Value<S>;
}
Expand description

Conversion into a Value.

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

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

Required Methods§

Source

fn into_value(self) -> Value<S>

Converts this value into a Value.

Implementations on Foreign Types§

Source§

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

Source§

fn into_value(self) -> Value<S>

Source§

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

Source§

fn into_value(self) -> Value<S>

Source§

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

Source§

fn into_value(self) -> Value<S>

Source§

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

Source§

fn into_value(self) -> Value<S>

Source§

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

Source§

fn into_value(self) -> Value<S>

Source§

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

Source§

fn into_value(self) -> Value<S>

Source§

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

Source§

fn into_value(self) -> Value<S>

Source§

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

Source§

fn into_value(self) -> Value<S>

Implementors§