Enum juniper::InputValue
[−]
[src]
pub enum InputValue { Null, Int(i32), Float(f64), String(String), Boolean(bool), Enum(String), Variable(String), List(Vec<Spanning<InputValue>>), Object(Vec<(Spanning<String>, Spanning<InputValue>)>), }
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
Int(i32)
Float(f64)
String(String)
Boolean(bool)
Enum(String)
Variable(String)
List(Vec<Spanning<InputValue>>)
Object(Vec<(Spanning<String>, Spanning<InputValue>)>)
Methods
impl InputValue
[src]
fn null() -> InputValue
[src]
Construct a null value.
fn int(i: i32) -> InputValue
[src]
Construct an integer value.
fn float(f: f64) -> InputValue
[src]
Construct a floating point value.
fn boolean(b: bool) -> InputValue
[src]
Construct a boolean value.
fn string<T: AsRef<str>>(s: T) -> InputValue
[src]
Construct a string value.
fn enum_value<T: AsRef<str>>(s: T) -> InputValue
[src]
Construct an enum value.
fn variable<T: AsRef<str>>(v: T) -> InputValue
[src]
Construct a variable value.
fn list(l: Vec<InputValue>) -> InputValue
[src]
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.
fn parsed_list(l: Vec<Spanning<InputValue>>) -> InputValue
[src]
Construct a located list.
fn object<K>(o: OrderMap<K, InputValue>) -> InputValue where
K: AsRef<str> + Eq + Hash,
[src]
K: AsRef<str> + Eq + Hash,
Construct an unlocated object.
Similar to InputValue::list
, it makes each key and value in the given
hash map not contain any location information.
fn parsed_object(o: Vec<(Spanning<String>, Spanning<InputValue>)>) -> InputValue
[src]
Construct a located object.
fn into_const(self, vars: &Variables) -> InputValue
[src]
Resolve all variables to their values.
fn convert<T>(&self) -> Option<T> where
T: FromInputValue,
[src]
T: FromInputValue,
Shorthand form of invoking FromInputValue::from()
.
fn is_null(&self) -> bool
[src]
Does the value represent null?
fn is_variable(&self) -> bool
[src]
Does the value represent a variable?
fn as_enum_value(&self) -> Option<&str>
[src]
View the underlying enum value, if present.
fn as_int_value(&self) -> Option<i32>
[src]
View the underlying int value, if present.
fn as_float_value(&self) -> Option<f64>
[src]
View the underlying float value, if present.
fn as_string_value(&self) -> Option<&str>
[src]
View the underlying string value, if present.
fn to_object_value(&self) -> Option<OrderMap<&str, &InputValue>>
[src]
Convert the input value to an unlocated object value.
This constructs a new OrderMap that contain references to the keys
and values in self
.
fn to_list_value(&self) -> Option<Vec<&InputValue>>
[src]
Convert the input value to an unlocated list value.
This constructs a new vector that contain references to the values
in self
.
fn referenced_variables(&self) -> Vec<&str>
[src]
Recursively find all variables
fn unlocated_eq(&self, other: &InputValue) -> bool
[src]
Compare equality with another InputValue
ignoring any source position information.
Trait Implementations
impl Clone for InputValue
[src]
fn clone(&self) -> InputValue
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for InputValue
[src]
fn eq(&self, __arg_0: &InputValue) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &InputValue) -> bool
[src]
This method tests for !=
.
impl Debug for InputValue
[src]
impl Display for InputValue
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<'de> Deserialize<'de> for InputValue
[src]
fn deserialize<D>(deserializer: D) -> Result<InputValue, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more