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(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 $
.
Tuple Fields of Variable
0: Name
null
.
Number(Number)
A number.
Tuple Fields of Number
0: Number
String(String)
A string.
Tuple Fields of String
0: String
Boolean(bool)
A boolean.
Tuple Fields of Boolean
0: bool
Binary(Bytes)
A binary.
Tuple Fields of Binary
0: Bytes
Enum(Name)
An enum. These are typically in SCREAMING_SNAKE_CASE
.
Tuple Fields of Enum
0: Name
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
Auto Trait Implementations
impl RefUnwindSafe for Value
impl UnwindSafe for Value
Blanket Implementations
Mutably borrows from an owned value. Read more