Enum async_graphql::Value[][src]

pub enum Value {
    Null,
    Number(Number),
    String(String),
    Boolean(bool),
    Enum(Name),
    List(Vec<ConstValue, Global>),
    Object(BTreeMap<Name, ConstValue>),
}

A resolved GraphQL value, for example 1 or "Hello World!".

It can be serialized and deserialized. Enums will be converted to strings. Attempting to serialize Upload will fail, and Enum and Upload cannot be deserialized.

Reference.

Variants

Null

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

impl ConstValue[src]

#[must_use]pub fn into_value(self) -> Value[src]

Convert this ConstValue into a Value.

pub fn into_json(self) -> Result<Value, Error>[src]

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

pub fn from_json(json: Value) -> Result<ConstValue, Error>[src]

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

impl Clone for ConstValue[src]

impl Debug for ConstValue[src]

impl Default for ConstValue[src]

impl<'de> Deserialize<'de> for ConstValue[src]

impl<'de> Deserializer<'de> for ConstValue[src]

type Error = DeserializerError

The error type that can be returned if some error occurs during deserialization. Read more

impl Display for ConstValue[src]

impl Eq for ConstValue[src]

impl<'a, T> From<&'a [T]> for ConstValue where
    T: Clone + Into<ConstValue>, 
[src]

impl<'a> From<&'a str> for ConstValue[src]

impl From<()> for ConstValue[src]

impl From<BTreeMap<Name, ConstValue>> for ConstValue[src]

impl<'a> From<Cow<'a, str>> for ConstValue[src]

impl From<String> for ConstValue[src]

impl From<Variables> for ConstValue[src]

impl<T> From<Vec<T, Global>> for ConstValue where
    T: Into<ConstValue>, 
[src]

impl From<bool> for ConstValue[src]

impl From<f32> for ConstValue[src]

impl From<f64> for ConstValue[src]

impl From<i16> for ConstValue[src]

impl From<i32> for ConstValue[src]

impl From<i64> for ConstValue[src]

impl From<i8> for ConstValue[src]

impl From<isize> for ConstValue[src]

impl From<u16> for ConstValue[src]

impl From<u32> for ConstValue[src]

impl From<u64> for ConstValue[src]

impl From<u8> for ConstValue[src]

impl From<usize> for ConstValue[src]

impl<T> FromIterator<T> for ConstValue where
    T: Into<ConstValue>, 
[src]

impl<'de> IntoDeserializer<'de, DeserializerError> for ConstValue[src]

type Deserializer = ConstValue

The type of the deserializer being converted into.

impl PartialEq<ConstValue> for ConstValue[src]

impl Serialize for ConstValue[src]

impl StructuralEq for ConstValue[src]

impl TryFrom<Value> for ConstValue[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> FutureExt for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]