Enum async_graphql_value::Value [−][src]
A GraphQL value, for example 1, $name or "Hello World!". This is
ConstValue with variables.
It can be serialized and deserialized. Enums will be converted to strings. Attempting to
serialize Upload or Variable will fail, and Enum, Upload and Variable cannot be
deserialized.
Variants
Variable(Name)A variable, without the $.
null.
Number(Number)A number.
String(String)A string.
Boolean(bool)A boolean.
Enum(Name)An enum. These are typically in SCREAMING_SNAKE_CASE.
A list of values.
An object. This is a map of keys to values.
Implementations
impl Value[src]
pub fn into_const_with<E>(
self,
f: impl FnMut(Name) -> Result<ConstValue, E>
) -> Result<ConstValue, E>[src]
self,
f: impl FnMut(Name) -> Result<ConstValue, E>
) -> Result<ConstValue, E>
Attempt to convert the value into a const value by using a function to get a variable.
#[must_use]pub fn into_const(self) -> Option<ConstValue>[src]
Attempt to convert the value into a const value.
Will fail if the value contains variables.
pub fn into_json(self) -> Result<Value>[src]
Attempt to convert the value into JSON. This is equivalent to the TryFrom implementation.
Errors
Fails if serialization fails (see enum docs for more info).
pub fn from_json(json: Value) -> Result<Self>[src]
Attempt to convert JSON into a value. This is equivalent to the TryFrom implementation.
Errors
Fails if deserialization fails (see enum docs for more info).
Trait Implementations
impl Clone for Value[src]
impl Debug for Value[src]
impl Default for Value[src]
impl<'de> Deserialize<'de> for Value[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
impl Display for Value[src]
impl Eq for Value[src]
impl From<ConstValue> for Value[src]
fn from(value: ConstValue) -> Self[src]
impl PartialEq<Value> for Value[src]
impl Serialize for Value[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer, [src]
__S: Serializer,
impl StructuralEq for Value[src]
impl StructuralPartialEq for Value[src]
impl TryFrom<Value> for Value[src]
Auto Trait Implementations
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
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.
pub 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>,