Enum juniper::Value [−][src]
pub enum Value {
Null,
Int(i32),
Float(f64),
String(String),
Boolean(bool),
List(Vec<Value>),
Object(Object),
}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
NullInt(i32)Float(f64)String(String)Boolean(bool)List(Vec<Value>)Object(Object)Methods
impl Value[src]
impl Valuepub fn null() -> Value[src]
pub fn null() -> ValueConstruct a null value.
pub fn int(i: i32) -> Value[src]
pub fn int(i: i32) -> ValueConstruct an integer value.
pub fn float(f: f64) -> Value[src]
pub fn float(f: f64) -> ValueConstruct a floating point value.
pub fn string<T: AsRef<str>>(s: T) -> Value[src]
pub fn string<T: AsRef<str>>(s: T) -> ValueConstruct a string value.
pub fn boolean(b: bool) -> Value[src]
pub fn boolean(b: bool) -> ValueConstruct a boolean value.
pub fn list(l: Vec<Value>) -> Value[src]
pub fn list(l: Vec<Value>) -> ValueConstruct a list value.
pub fn object(o: Object) -> Value[src]
pub fn object(o: Object) -> ValueConstruct an object value.
pub fn is_null(&self) -> bool[src]
pub fn is_null(&self) -> boolDoes this value represent null?
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_object_value(&self) -> Option<&Object>[src]
pub fn as_object_value(&self) -> Option<&Object>View the underlying object value, if present.
pub fn as_mut_object_value(&mut self) -> Option<&mut Object>[src]
pub fn as_mut_object_value(&mut self) -> Option<&mut Object>Mutable view into the underlying object value, if present.
pub fn as_list_value(&self) -> Option<&Vec<Value>>[src]
pub fn as_list_value(&self) -> Option<&Vec<Value>>View the underlying list 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.
Trait Implementations
impl Debug for Value[src]
impl Debug for Valuefn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl PartialEq for Value[src]
impl PartialEq for Valuefn eq(&self, other: &Value) -> bool[src]
fn eq(&self, other: &Value) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Value) -> bool[src]
fn ne(&self, other: &Value) -> boolThis method tests for !=.
impl Clone for Value[src]
impl Clone for Valuefn clone(&self) -> Value[src]
fn clone(&self) -> ValueReturns 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 From<Object> for Value[src]
impl From<Object> for Valueimpl ToInputValue for Value[src]
impl ToInputValue for Valuefn to_input_value(&self) -> InputValue[src]
fn to_input_value(&self) -> InputValuePerforms the conversion.
impl<'a> From<&'a str> for Value[src]
impl<'a> From<&'a str> for Valueimpl From<String> for Value[src]
impl From<String> for Valueimpl From<bool> for Value[src]
impl From<bool> for Valueimpl From<i32> for Value[src]
impl From<i32> for Valueimpl From<f64> for Value[src]
impl From<f64> for Valueimpl<T> From<Option<T>> for Value where
Value: From<T>, [src]
impl<T> From<Option<T>> for Value where
Value: From<T>, impl Serialize for Value[src]
impl Serialize for Value