Enum async_graphql_value::ConstValue [−][src]
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.
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>
[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 ConstValue
[src]
fn clone(&self) -> ConstValue
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ConstValue
[src]
impl Default for ConstValue
[src]
impl<'de> Deserialize<'de> for ConstValue
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<'de> Deserializer<'de> for ConstValue
[src]
type Error = DeserializerError
The error type that can be returned if some error occurs during deserialization. Read more
fn deserialize_any<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, Self::Error> where
V: Visitor<'de>,
[src]
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_bool<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_i8<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_i16<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_i32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_i64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_i128<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_u8<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_u16<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_u32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_u64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_u128<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_f32<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_f64<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_char<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_str<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_string<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_bytes<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_byte_buf<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_unit<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_unit_struct<V>(
self,
name: &'static str,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
self,
name: &'static str,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_seq<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_tuple<V>(
self,
len: usize,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
self,
len: usize,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_tuple_struct<V>(
self,
name: &'static str,
len: usize,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
self,
name: &'static str,
len: usize,
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_map<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_struct<V>(
self,
name: &'static str,
fields: &'static [&'static str],
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
self,
name: &'static str,
fields: &'static [&'static str],
visitor: V
) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_identifier<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_ignored_any<V>(self, visitor: V) -> Result<V::Value, Self::Error> where
V: Visitor<'de>,
[src]
V: Visitor<'de>,
fn deserialize_option<V>(
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, Self::Error> where
V: Visitor<'de>,
[src]
self,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_newtype_struct<V>(
self,
_name: &'static str,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, Self::Error> where
V: Visitor<'de>,
[src]
self,
_name: &'static str,
visitor: V
) -> Result<<V as Visitor<'de>>::Value, Self::Error> where
V: Visitor<'de>,
fn deserialize_enum<V>(
self,
_name: &'static str,
_variants: &'static [&'static str],
visitor: V
) -> Result<<V as Visitor<'de>>::Value, Self::Error> where
V: Visitor<'de>,
[src]
self,
_name: &'static str,
_variants: &'static [&'static str],
visitor: V
) -> Result<<V as Visitor<'de>>::Value, Self::Error> where
V: Visitor<'de>,
pub fn is_human_readable(&self) -> bool
[src]
impl Display for ConstValue
[src]
impl Eq for ConstValue
[src]
impl<'a, T: Clone + Into<ConstValue>> From<&'a [T]> for ConstValue
[src]
impl<'a> From<&'a str> for ConstValue
[src]
impl From<()> for ConstValue
[src]
impl From<BTreeMap<Name, ConstValue>> for ConstValue
[src]
fn from(f: BTreeMap<Name, ConstValue>) -> Self
[src]
impl From<ConstValue> for Value
[src]
fn from(value: ConstValue) -> Self
[src]
impl<'a> From<Cow<'a, str>> for ConstValue
[src]
impl From<String> for ConstValue
[src]
impl From<Variables> for ConstValue
[src]
impl<T: Into<ConstValue>> From<Vec<T, Global>> for ConstValue
[src]
impl From<bool> for ConstValue
[src]
impl From<f32> for ConstValue
[src]
impl From<f64> for ConstValue
[src]
impl From<i16> for ConstValue
[src]
impl From<i32> for ConstValue
[src]
impl From<i64> for ConstValue
[src]
impl From<i8> for ConstValue
[src]
impl From<isize> for ConstValue
[src]
impl From<u16> for ConstValue
[src]
impl From<u32> for ConstValue
[src]
impl From<u64> for ConstValue
[src]
impl From<u8> for ConstValue
[src]
impl From<usize> for ConstValue
[src]
impl<T: Into<ConstValue>> FromIterator<T> for ConstValue
[src]
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
[src]
impl<'de> IntoDeserializer<'de, DeserializerError> for ConstValue
[src]
type Deserializer = Self
The type of the deserializer being converted into.
fn into_deserializer(self) -> Self::Deserializer
[src]
impl PartialEq<ConstValue> for ConstValue
[src]
fn eq(&self, other: &ConstValue) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for ConstValue
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq 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,
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>,