Enum juniper::InputValue

source ·
pub enum InputValue<S = DefaultScalarValue> {
    Null,
    Scalar(S),
    Enum(String),
    Variable(String),
    List(Vec<Spanning<InputValue<S>>>),
    Object(Vec<(Spanning<String>, Spanning<InputValue<S>>)>),
}
Expand description

A JSON-like value that can be passed into the query execution, either out-of-band, or in-band as default variable values. These are not constant and might contain variables.

Lists and objects variants are spanned, i.e. they contain a reference to their position in the source file, if available.

Variants

Null

Scalar(S)

Enum(String)

Variable(String)

List(Vec<Spanning<InputValue<S>>>)

Object(Vec<(Spanning<String>, Spanning<InputValue<S>>)>)

Implementations

Construct a null value.

👎Deprecated since 0.11.0: Use InputValue::scalar instead

Construct an integer value.

👎Deprecated since 0.11.0: Use InputValue::scalar instead

Construct a floating point value.

👎Deprecated since 0.11.0: Use InputValue::scalar instead

Construct a boolean value.

👎Deprecated since 0.11.0: Use InputValue::scalar instead

Construct a string value.

Construct a scalar value

Construct an enum value.

Construct a variable value.

Construct an unlocated list.

Convenience function to make each InputValue in the input vector not contain any location information. Can be used from ToInputValue implementations, where no source code position information is available.

Construct a located list.

Construct an unlocated object.

Similar to InputValue::list, it makes each key and value in the given hash map not contain any location information.

Construct a located object.

Resolve all variables to their values.

Shorthand form of invoking FromInputValue::from().

Does the value represent null?

Does the value represent a variable?

View the underlying enum value, if present.

👎Deprecated since 0.11.0: Use InputValue::as_scalar_value instead

View the underlying int value, if present.

👎Deprecated since 0.11.0: Use InputValue::as_scalar_value instead

View the underlying float value, if present.

👎Deprecated since 0.11.0: Use InputValue::as_scalar_value instead

View the underlying string value, if present.

View the underlying scalar value, if present.

View the underlying scalar value, if present.

Convert the input value to an unlocated object value.

This constructs a new IndexMap that contain references to the keys and values in self.

Convert the input value to an unlocated list value.

This constructs a new vector that contain references to the values in self.

Recursively find all variables

Compare equality with another InputValue ignoring any source position information.

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
Deserialize this value from the given Serde deserializer. Read more
Formats the value using the given formatter. Read more
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

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