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.