[−][src]Enum juniper::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
Object(Object<S>)
Methods
impl<S> Value<S> where
S: ScalarValue,
[src]
S: ScalarValue,
pub fn null() -> Self
[src]
Construct a null value.
pub fn int(i: i32) -> Self
[src]
Use Value::scalar
instead
Construct an integer value.
pub fn float(f: f64) -> Self
[src]
Use Value::scalar
instead
Construct a floating point value.
pub fn string(s: &str) -> Self
[src]
Use Value::scalar
instead
Construct a string value.
pub fn boolean(b: bool) -> Self
[src]
Use Value::scalar
instead
Construct a boolean value.
pub fn list(l: Vec<Self>) -> Self
[src]
Construct a list value.
pub fn object(o: Object<S>) -> Self
[src]
Construct an object value.
pub fn scalar<T>(s: T) -> Self where
T: Into<S>,
[src]
T: Into<S>,
Construct a scalar value
pub fn is_null(&self) -> bool
[src]
Does this value represent null?
pub fn as_scalar_value<'a, T>(&'a self) -> Option<&'a T> where
&'a S: Into<Option<&'a T>>,
[src]
&'a S: Into<Option<&'a T>>,
View the underlying scalar value if present
pub fn as_float_value(&self) -> Option<f64> where
&'a S: ScalarRefValue<'a>,
[src]
&'a S: ScalarRefValue<'a>,
Use Value::as_scalar_value
instead
View the underlying float value, if present.
pub fn as_object_value(&self) -> Option<&Object<S>>
[src]
View the underlying object value, if present.
pub fn as_mut_object_value(&mut self) -> Option<&mut Object<S>>
[src]
Mutable view into the underlying object value, if present.
pub fn as_list_value(&self) -> Option<&Vec<Self>>
[src]
View the underlying list value, if present.
pub fn as_scalar(&self) -> Option<&S>
[src]
View the underlying scalar value, if present
pub fn as_string_value<'a>(&'a self) -> Option<&'a str> where
Option<&'a String>: From<&'a S>,
[src]
Option<&'a String>: From<&'a S>,
Use Value::as_scalar_value
instead
View the underlying string value, if present.
Trait Implementations
impl<S: ScalarValue> ToInputValue<S> for Value<S>
[src]
fn to_input_value(&self) -> InputValue<S>
[src]
impl<S> From<Object<S>> for Value<S>
[src]
impl<S, T> From<Option<T>> for Value<S> where
S: ScalarValue,
Value<S>: From<T>,
[src]
S: ScalarValue,
Value<S>: From<T>,
impl<'a, S> From<&'a str> for Value<S> where
S: ScalarValue,
[src]
S: ScalarValue,
impl<S> From<String> for Value<S> where
S: ScalarValue,
[src]
S: ScalarValue,
impl<S> From<i32> for Value<S> where
S: ScalarValue,
[src]
S: ScalarValue,
impl<S> From<f64> for Value<S> where
S: ScalarValue,
[src]
S: ScalarValue,
impl<S> From<bool> for Value<S> where
S: ScalarValue,
[src]
S: ScalarValue,
impl<S: Clone> Clone for Value<S>
[src]
impl<S: PartialEq> PartialEq<Value<S>> for Value<S>
[src]
impl<S: Debug> Debug for Value<S>
[src]
impl<T> Serialize for Value<T> where
T: Serialize,
[src]
T: Serialize,
Auto Trait Implementations
impl<S> Send for Value<S> where
S: Send,
S: Send,
impl<S> Sync for Value<S> where
S: Sync,
S: Sync,
impl<S> Unpin for Value<S> where
S: Unpin,
S: Unpin,
impl<S> UnwindSafe for Value<S> where
S: UnwindSafe,
S: UnwindSafe,
impl<S> RefUnwindSafe for Value<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,