Enum async_graphql_value::Value [−][src]
pub enum Value {
Variable(Name),
Null,
Number(Number),
String(String),
Boolean(bool),
Binary(Bytes),
Enum(Name),
List(Vec<Value>),
Object(IndexMap<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)
Tuple Fields
0: NameA variable, without the $.
Null
null.
Number(Number)
Tuple Fields
0: NumberA number.
String(String)
Tuple Fields
0: StringA string.
Boolean(bool)
Tuple Fields
0: boolA boolean.
Binary(Bytes)
Tuple Fields
0: BytesA binary.
Enum(Name)
Tuple Fields
0: NameAn enum. These are typically in SCREAMING_SNAKE_CASE.
List(Vec<Value>)
A list of values.
Object(IndexMap<Name, Value>)
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
Auto Trait Implementations
impl RefUnwindSafe for Value
impl UnwindSafe for Value
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.
