Enum juniper::InputValue [−][src]
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
Enum(String)
Variable(String)
List(Vec<Spanning<InputValue<S>>>)
Implementations
impl<S> InputValue<S> where
S: ScalarValue,
[src]
impl<S> InputValue<S> where
S: ScalarValue,
[src]pub fn int(i: i32) -> Self
[src]
👎 Deprecated since 0.11.0: Use InputValue::scalar
instead
pub fn int(i: i32) -> Self
[src]Use InputValue::scalar
instead
Construct an integer value.
pub fn float(f: f64) -> Self
[src]
👎 Deprecated since 0.11.0: Use InputValue::scalar
instead
pub fn float(f: f64) -> Self
[src]Use InputValue::scalar
instead
Construct a floating point value.
pub fn boolean(b: bool) -> Self
[src]
👎 Deprecated since 0.11.0: Use InputValue::scalar
instead
pub fn boolean(b: bool) -> Self
[src]Use InputValue::scalar
instead
Construct a boolean value.
pub fn string<T: AsRef<str>>(s: T) -> Self
[src]
👎 Deprecated since 0.11.0: Use InputValue::scalar
instead
pub fn string<T: AsRef<str>>(s: T) -> Self
[src]Use InputValue::scalar
instead
Construct a string value.
pub fn enum_value<T: AsRef<str>>(s: T) -> Self
[src]
pub fn enum_value<T: AsRef<str>>(s: T) -> Self
[src]Construct an enum value.
pub fn list(l: Vec<Self>) -> Self
[src]
pub fn list(l: Vec<Self>) -> Self
[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.
pub fn parsed_list(l: Vec<Spanning<Self>>) -> Self
[src]
pub fn parsed_list(l: Vec<Spanning<Self>>) -> Self
[src]Construct a located list.
pub fn object<K>(o: IndexMap<K, Self>) -> Self where
K: AsRef<str> + Eq + Hash,
[src]
pub fn object<K>(o: IndexMap<K, Self>) -> Self where
K: AsRef<str> + Eq + Hash,
[src]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<Self>)>) -> Self
[src]
pub fn parsed_object(o: Vec<(Spanning<String>, Spanning<Self>)>) -> Self
[src]Construct a located object.
pub fn into_const(self, vars: &Variables<S>) -> Self
[src]
pub fn into_const(self, vars: &Variables<S>) -> Self
[src]Resolve all variables to their values.
pub fn convert<T>(&self) -> Option<T> where
T: FromInputValue<S>,
[src]
pub fn convert<T>(&self) -> Option<T> where
T: FromInputValue<S>,
[src]Shorthand form of invoking FromInputValue::from()
.
pub fn is_variable(&self) -> bool
[src]
pub fn is_variable(&self) -> bool
[src]Does the value represent a variable?
pub fn as_enum_value(&self) -> Option<&str>
[src]
pub fn as_enum_value(&self) -> Option<&str>
[src]View the underlying enum value, if present.
pub fn as_int_value(&self) -> Option<i32>
[src]
pub fn as_int_value(&self) -> Option<i32>
[src]View the underlying int value, if present.
pub fn as_float_value(&self) -> Option<f64>
[src]
pub fn as_float_value(&self) -> Option<f64>
[src]View the underlying float value, if present.
pub fn as_string_value(&self) -> Option<&str>
[src]
pub fn as_string_value(&self) -> Option<&str>
[src]View the underlying string value, if present.
pub fn as_scalar_value<'a, T>(&'a self) -> Option<&'a T> where
T: 'a,
&'a S: Into<Option<&'a T>>,
[src]
pub fn as_scalar_value<'a, T>(&'a self) -> Option<&'a T> where
T: 'a,
&'a S: Into<Option<&'a T>>,
[src]View the underlying scalar value, if present.
pub fn to_object_value(&self) -> Option<IndexMap<&str, &Self>>
[src]
pub fn to_object_value(&self) -> Option<IndexMap<&str, &Self>>
[src]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<&Self>>
[src]
pub fn to_list_value(&self) -> Option<Vec<&Self>>
[src]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>
[src]Recursively find all variables
pub fn unlocated_eq(&self, other: &Self) -> bool
[src]
pub fn unlocated_eq(&self, other: &Self) -> bool
[src]Compare equality with another InputValue
ignoring any source position information.
Trait Implementations
impl<S: Clone> Clone for InputValue<S>
[src]
impl<S: Clone> Clone for InputValue<S>
[src]fn clone(&self) -> InputValue<S>
[src]
fn clone(&self) -> InputValue<S>
[src]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)
1.0.0[src]Performs copy-assignment from source
. Read more
impl<S: Debug> Debug for InputValue<S>
[src]
impl<S: Debug> Debug for InputValue<S>
[src]impl<'de, S> Deserialize<'de> for InputValue<S> where
S: ScalarValue,
[src]
impl<'de, S> Deserialize<'de> for InputValue<S> where
S: ScalarValue,
[src]fn deserialize<D>(deserializer: D) -> Result<InputValue<S>, D::Error> where
D: Deserializer<'de>,
[src]
fn deserialize<D>(deserializer: D) -> Result<InputValue<S>, D::Error> where
D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl<S> Display for InputValue<S> where
S: ScalarValue,
[src]
impl<S> Display for InputValue<S> where
S: ScalarValue,
[src]impl<S: PartialEq> PartialEq<InputValue<S>> for InputValue<S>
[src]
impl<S: PartialEq> PartialEq<InputValue<S>> for InputValue<S>
[src]fn eq(&self, other: &InputValue<S>) -> bool
[src]
fn eq(&self, other: &InputValue<S>) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &InputValue<S>) -> bool
[src]
fn ne(&self, other: &InputValue<S>) -> bool
[src]This method tests for !=
.
impl<T> Serialize for InputValue<T> where
T: ScalarValue,
[src]
impl<T> Serialize for InputValue<T> where
T: ScalarValue,
[src]impl<S> StructuralPartialEq for InputValue<S>
[src]
Auto Trait Implementations
impl<S> RefUnwindSafe for InputValue<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
impl<S> Send for InputValue<S> where
S: Send,
S: Send,
impl<S> Sync for InputValue<S> where
S: Sync,
S: Sync,
impl<S> Unpin for InputValue<S> where
S: Unpin,
S: Unpin,
impl<S> UnwindSafe for InputValue<S> where
S: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,