Enum juniper::Value
[−]
[src]
pub enum Value { Null, Int(i32), Float(f64), String(String), Boolean(bool), List(Vec<Value>), Object(OrderMap<String, Value>), }
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
Int(i32)
Float(f64)
String(String)
Boolean(bool)
List(Vec<Value>)
Object(OrderMap<String, Value>)
Methods
impl Value
[src]
fn null() -> Value
[src]
Construct a null value.
fn int(i: i32) -> Value
[src]
Construct an integer value.
fn float(f: f64) -> Value
[src]
Construct a floating point value.
fn string<T: AsRef<str>>(s: T) -> Value
[src]
Construct a string value.
fn boolean(b: bool) -> Value
[src]
Construct a boolean value.
fn list(l: Vec<Value>) -> Value
[src]
Construct a list value.
fn object<K>(o: OrderMap<K, Value>) -> Value where
K: Into<String> + Eq + Hash,
[src]
K: Into<String> + Eq + Hash,
Construct an object value.
fn is_null(&self) -> bool
[src]
Does this value represent null?
fn as_float_value(&self) -> Option<&f64>
[src]
View the underlying float value, if present.
fn as_object_value(&self) -> Option<&OrderMap<String, Value>>
[src]
View the underlying object value, if present.
fn as_mut_object_value(&mut self) -> Option<&mut OrderMap<String, Value>>
[src]
Mutable view into the underlying object value, if present.
fn as_list_value(&self) -> Option<&Vec<Value>>
[src]
View the underlying list value, if present.
fn as_string_value(&self) -> Option<&str>
[src]
View the underlying string value, if present.
Trait Implementations
impl Debug for Value
[src]
impl PartialEq for Value
[src]
fn eq(&self, __arg_0: &Value) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Value) -> bool
[src]
This method tests for !=
.
impl ToInputValue for Value
[src]
fn to_input_value(&self) -> InputValue
[src]
Performs the conversion.
impl<'a> From<&'a str> for Value
[src]
impl From<String> for Value
[src]
impl From<bool> for Value
[src]
impl From<i32> for Value
[src]
impl From<f64> for Value
[src]
impl<T> From<Option<T>> for Value where
Value: From<T>,
[src]
Value: From<T>,