Enum juniper::Value

source ·
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: Use Value::scalar instead

Construct an integer value.

👎Deprecated since 0.11: Use Value::scalar instead

Construct a floating point value.

👎Deprecated since 0.11: Use Value::scalar instead

Construct a string value.

👎Deprecated since 0.11: 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

👎Deprecated since 0.11: Use Value::as_scalar_value instead

View the underlying float value, if present.

View the underlying object value, if present.

Mutable view into the underlying object value, if present.

View the underlying list value, if present.

View the underlying scalar value, if present

👎Deprecated since 0.11: Use Value::as_scalar_value instead

View the underlying string value, if present.

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
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. 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.