pub struct GraphqlResponse { /* private fields */ }Expand description
Spec-compliant GraphQL HTTP response envelope ({"data": ..., "errors": [...]}).
Implementations§
Source§impl GraphqlResponse
Constructors for GraphqlResponse.
impl GraphqlResponse
Constructors for GraphqlResponse.
Sourcepub fn from_error<S>(message: S) -> Self
pub fn from_error<S>(message: S) -> Self
Creates an error-only GraphqlResponse.
§Arguments
S- Error message string.
§Returns
Self- GraphQL response containing a single error.
Source§impl GraphqlResponse
impl GraphqlResponse
pub fn get_data(&self) -> Value
pub fn try_get_data(&self) -> &Option<Value>
pub fn get_errors(&self) -> &Vec<GraphqlError>
Trait Implementations§
Source§impl Clone for GraphqlResponse
impl Clone for GraphqlResponse
Source§impl Debug for GraphqlResponse
impl Debug for GraphqlResponse
Source§impl<'de> Deserialize<'de> for GraphqlResponse
impl<'de> Deserialize<'de> for GraphqlResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for GraphqlResponse
Source§impl PartialEq for GraphqlResponse
impl PartialEq for GraphqlResponse
Source§impl Serialize for GraphqlResponse
impl Serialize for GraphqlResponse
impl StructuralPartialEq for GraphqlResponse
Auto Trait Implementations§
impl Forget for GraphqlResponse
impl Freeze for GraphqlResponsewhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
PhantomData<GraphqlError>: Freeze,
impl Move for GraphqlResponse
impl RefUnwindSafe for GraphqlResponse
impl Send for GraphqlResponse
impl Sync for GraphqlResponse
impl Unpin for GraphqlResponse
impl UnsafeUnpin for GraphqlResponsewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
PhantomData<GraphqlError>: UnsafeUnpin,
impl UnwindSafe for GraphqlResponse
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.