Enum async_graphql_value::Value [−][src]
pub enum Value {
Variable(Name),
Null,
Number(Number),
String(String),
Boolean(bool),
Enum(Name),
List(Vec<Value>),
Object(BTreeMap<Name, Value>),
}Expand description
A GraphQL value, for example 1, $name or "Hello World!". This is
ConstValue with variables.
It can be serialized and deserialized. Enums will be converted to strings. Attempting to
serialize Upload or Variable will fail, and Enum, Upload and Variable cannot be
deserialized.
Variants
Variable(Name)A variable, without the $.
null.
Number(Number)A number.
String(String)A string.
Boolean(bool)A boolean.
Enum(Name)An enum. These are typically in SCREAMING_SNAKE_CASE.
A list of values.
An object. This is a map of keys to values.
Implementations
pub fn into_const_with<E>(
self,
f: impl FnMut(Name) -> Result<ConstValue, E>
) -> Result<ConstValue, E>
pub fn into_const_with<E>(
self,
f: impl FnMut(Name) -> Result<ConstValue, E>
) -> Result<ConstValue, E>Attempt to convert the value into a const value by using a function to get a variable.
Attempt to convert the value into a const value.
Will fail if the value contains variables.
Attempt to convert the value into JSON. This is equivalent to the TryFrom implementation.
Errors
Fails if serialization fails (see enum docs for more info).
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, Deserialize this value from the given Serde deserializer. Read more
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for Valueimpl UnwindSafe for ValueBlanket Implementations
Mutably borrows from an owned value. Read more