Enum juniper::Value[][src]

pub enum Value<S = DefaultScalarValue> {
    Null,
    Scalar(S),
    List(Vec<Value<S>>),
    Object(Object<S>),
}
Expand description

Serializable value returned from query and field execution.

Used by the execution engine and resolvers to build up the response structure. Similar to the Json type found in the serialize crate.

It is also similar to the InputValue type, but can not contain enum values or variables. Also, lists and objects do not contain any location information since they are generated by resolving fields and values rather than parsing a source query.

Variants

Null
Scalar(S)
List(Vec<Value<S>>)
Object(Object<S>)

Implementations

Construct a null value.

👎 Deprecated since 0.11.0:

Use Value::scalar instead

Construct an integer value.

👎 Deprecated since 0.11.0:

Use Value::scalar instead

Construct a floating point value.

👎 Deprecated since 0.11.0:

Use Value::scalar instead

Construct a string value.

👎 Deprecated since 0.11.0:

Use Value::scalar instead

Construct a boolean value.

Construct a list value.

Construct an object value.

Construct a scalar value

Does this value represent null?

View the underlying scalar value if present

View the underlying float value, if present.

View the underlying object value, if present.

Convert this value into an Object.

Returns None if value is not an Object.

Mutable view into the underlying object value, if present.

View the underlying list value, if present.

View the underlying scalar value, if present

View the underlying string value, if present.

Maps the ScalarValue type of this Value into the specified one.

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

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

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

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.