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.

Reference.

Variants

Variable(Name)

A variable, without the $.

Tuple Fields of Variable

0: Name
Null

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
List(Vec<Value>)

A list of values.

Tuple Fields of List

0: Vec<Value>
Object(BTreeMap<Name, Value>)

An object. This is a map of keys to values.

Tuple Fields of Object

0: BTreeMap<Name, Value>

Implementations

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).

Attempt to convert JSON into a value. This is equivalent to the TryFrom implementation.

Errors

Fails if deserialization fails (see enum docs for more info).

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.