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