pub trait ToScalarValue<S = DefaultScalarValue> {
// Required method
fn to_scalar_value(&self) -> S;
}Expand description
Conversion of a Rust data type into a ScalarValue.
§Implementation
Implementing this trait for a type allows to specify this type directly in the to_output()
function when implementing a GraphQLScalar via derive macro.
Also, #[derive(GraphQLScalar)] automatically implements this trait
for a type.
Required Methods§
Sourcefn to_scalar_value(&self) -> S
fn to_scalar_value(&self) -> S
Converts this value into a ScalarValue.
Implementations on Foreign Types§
Source§impl<S: ScalarValue> ToScalarValue<S> for str
impl<S: ScalarValue> ToScalarValue<S> for str
fn to_scalar_value(&self) -> S
Source§impl<T, S> ToScalarValue<S> for &Twhere
T: ToScalarValue<S> + ?Sized,
impl<T, S> ToScalarValue<S> for &Twhere
T: ToScalarValue<S> + ?Sized,
fn to_scalar_value(&self) -> S
Source§impl<T, S> ToScalarValue<S> for Box<T>where
T: ToScalarValue<S> + ?Sized,
impl<T, S> ToScalarValue<S> for Box<T>where
T: ToScalarValue<S> + ?Sized,
fn to_scalar_value(&self) -> S
Source§impl<T, S> ToScalarValue<S> for Arc<T>where
T: ToScalarValue<S> + ?Sized,
impl<T, S> ToScalarValue<S> for Arc<T>where
T: ToScalarValue<S> + ?Sized,
fn to_scalar_value(&self) -> S
Source§impl<Tz, __S> ToScalarValue<__S> for DateTime<Tz>
Available on crate feature chrono only.
impl<Tz, __S> ToScalarValue<__S> for DateTime<Tz>
Available on crate feature
chrono only.fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for Tzwhere
__S: ScalarValue,
Available on crate feature chrono-tz only.
impl<__S> ToScalarValue<__S> for Tzwhere
__S: ScalarValue,
Available on crate feature
chrono-tz only.fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for boolwhere
__S: ScalarValue,
impl<__S> ToScalarValue<__S> for boolwhere
__S: ScalarValue,
fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for f64where
__S: ScalarValue,
impl<__S> ToScalarValue<__S> for f64where
__S: ScalarValue,
fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for i32where
__S: ScalarValue,
impl<__S> ToScalarValue<__S> for i32where
__S: ScalarValue,
fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for Stringwhere
__S: ScalarValue,
impl<__S> ToScalarValue<__S> for Stringwhere
__S: ScalarValue,
fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for BigDecimalwhere
__S: ScalarValue,
Available on crate feature bigdecimal only.
impl<__S> ToScalarValue<__S> for BigDecimalwhere
__S: ScalarValue,
Available on crate feature
bigdecimal only.fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for DateTimewhere
__S: ScalarValue,
Available on crate feature bson only.
impl<__S> ToScalarValue<__S> for DateTimewhere
__S: ScalarValue,
Available on crate feature
bson only.fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for ObjectIdwhere
__S: ScalarValue,
Available on crate feature bson only.
impl<__S> ToScalarValue<__S> for ObjectIdwhere
__S: ScalarValue,
Available on crate feature
bson only.fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for NaiveDatewhere
__S: ScalarValue,
Available on crate feature chrono only.
impl<__S> ToScalarValue<__S> for NaiveDatewhere
__S: ScalarValue,
Available on crate feature
chrono only.fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for NaiveDateTimewhere
__S: ScalarValue,
Available on crate feature chrono only.
impl<__S> ToScalarValue<__S> for NaiveDateTimewhere
__S: ScalarValue,
Available on crate feature
chrono only.fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for NaiveTimewhere
__S: ScalarValue,
Available on crate feature chrono only.
impl<__S> ToScalarValue<__S> for NaiveTimewhere
__S: ScalarValue,
Available on crate feature
chrono only.fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for CompactStringwhere
__S: ScalarValue,
impl<__S> ToScalarValue<__S> for CompactStringwhere
__S: ScalarValue,
fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for Datewhere
__S: ScalarValue,
Available on crate feature jiff only.
impl<__S> ToScalarValue<__S> for Datewhere
__S: ScalarValue,
Available on crate feature
jiff only.fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for DateTimewhere
__S: ScalarValue,
Available on crate feature jiff only.
impl<__S> ToScalarValue<__S> for DateTimewhere
__S: ScalarValue,
Available on crate feature
jiff only.fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for Timewhere
__S: ScalarValue,
Available on crate feature jiff only.
impl<__S> ToScalarValue<__S> for Timewhere
__S: ScalarValue,
Available on crate feature
jiff only.fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for Spanwhere
__S: ScalarValue,
Available on crate feature jiff only.
impl<__S> ToScalarValue<__S> for Spanwhere
__S: ScalarValue,
Available on crate feature
jiff only.fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for Timestampwhere
__S: ScalarValue,
Available on crate feature jiff only.
impl<__S> ToScalarValue<__S> for Timestampwhere
__S: ScalarValue,
Available on crate feature
jiff only.fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for Offsetwhere
__S: ScalarValue,
Available on crate feature jiff only.
impl<__S> ToScalarValue<__S> for Offsetwhere
__S: ScalarValue,
Available on crate feature
jiff only.fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for TimeZonewhere
__S: ScalarValue,
Available on crate feature jiff only.
impl<__S> ToScalarValue<__S> for TimeZonewhere
__S: ScalarValue,
Available on crate feature
jiff only.fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for Zonedwhere
__S: ScalarValue,
Available on crate feature jiff only.
impl<__S> ToScalarValue<__S> for Zonedwhere
__S: ScalarValue,
Available on crate feature
jiff only.fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for Decimalwhere
__S: ScalarValue,
Available on crate feature rust_decimal only.
impl<__S> ToScalarValue<__S> for Decimalwhere
__S: ScalarValue,
Available on crate feature
rust_decimal only.fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for Datewhere
__S: ScalarValue,
Available on crate feature time only.
impl<__S> ToScalarValue<__S> for Datewhere
__S: ScalarValue,
Available on crate feature
time only.fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for OffsetDateTimewhere
__S: ScalarValue,
Available on crate feature time only.
impl<__S> ToScalarValue<__S> for OffsetDateTimewhere
__S: ScalarValue,
Available on crate feature
time only.fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for PrimitiveDateTimewhere
__S: ScalarValue,
Available on crate feature time only.
impl<__S> ToScalarValue<__S> for PrimitiveDateTimewhere
__S: ScalarValue,
Available on crate feature
time only.fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for Timewhere
__S: ScalarValue,
Available on crate feature time only.
impl<__S> ToScalarValue<__S> for Timewhere
__S: ScalarValue,
Available on crate feature
time only.fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for UtcOffsetwhere
__S: ScalarValue,
Available on crate feature time only.
impl<__S> ToScalarValue<__S> for UtcOffsetwhere
__S: ScalarValue,
Available on crate feature
time only.fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for Urlwhere
__S: ScalarValue,
Available on crate feature url only.
impl<__S> ToScalarValue<__S> for Urlwhere
__S: ScalarValue,
Available on crate feature
url only.fn to_scalar_value(&self) -> __S
Source§impl<__S> ToScalarValue<__S> for Uuidwhere
__S: ScalarValue,
Available on crate feature uuid only.
impl<__S> ToScalarValue<__S> for Uuidwhere
__S: ScalarValue,
Available on crate feature
uuid only.fn to_scalar_value(&self) -> __S
Implementors§
impl<__S> ToScalarValue<__S> for juniper::integrations::jiff::TimeZonewhere
__S: ScalarValue,
Available on crate feature
jiff only.