[−][src]Enum async_graphql::Value
A resolved GraphQL value, for example 1 or "Hello World!".
It can be serialized and deserialized. Enums will be converted to strings. Attempting to
serialize Upload will fail, and Enum and Upload cannot be deserialized.
Variants
null.
Number(Number)A number.
String(String)A string.
Boolean(bool)A boolean.
Enum(Name)An enum. These are typically in SCREAMING_SNAKE_CASE.
List(Vec<ConstValue>)A list of values.
Object(BTreeMap<Name, ConstValue>)An object. This is a map of keys to values.
Upload(UploadValue)An uploaded file.
Implementations
impl ConstValue[src]
#[must_use]pub fn into_value(self) -> Value[src]
Convert this ConstValue into a Value.
pub fn into_json(self) -> Result<Value, Error>[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<ConstValue, Error>[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 ConstValue[src]
fn clone(&self) -> ConstValue[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for ConstValue[src]
impl Default for ConstValue[src]
fn default() -> ConstValue[src]
impl<'de> Deserialize<'de> for ConstValue[src]
fn deserialize<__D>(
__deserializer: __D
) -> Result<ConstValue, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>, [src]
__deserializer: __D
) -> Result<ConstValue, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl Display for ConstValue[src]
impl Eq for ConstValue[src]
impl From<Variables> for Value[src]
impl PartialEq<ConstValue> for ConstValue[src]
fn eq(&self, other: &ConstValue) -> bool[src]
fn ne(&self, other: &ConstValue) -> bool[src]
impl Serialize for ConstValue[src]
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer, [src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
impl StructuralEq for ConstValue[src]
impl StructuralPartialEq for ConstValue[src]
impl TryFrom<Value> for ConstValue[src]
Auto Trait Implementations
impl RefUnwindSafe for ConstValue
impl Send for ConstValue
impl Sync for ConstValue
impl Unpin for ConstValue
impl UnwindSafe for ConstValue
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,
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<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool[src]
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.
fn to_owned(&self) -> T[src]
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.
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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,