Trait GraphqlOperation

Source
pub trait GraphqlOperation: Serialize {
    type Response;
    type Error: Error;

    // Required method
    fn decode(&self, data: Value) -> Result<Self::Response, Self::Error>;
}
Expand description

An abstraction over GraphQL operations.

Required Associated Types§

Source

type Response

The actual response & error type of this operation.

Source

type Error: Error

The error that will be returned from failed attempts to decode a Response.

Required Methods§

Source

fn decode(&self, data: Value) -> Result<Self::Response, Self::Error>

Decodes a GenericResponse into the actual response that will be returned to users for this operation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<ResponseData, Variables> GraphqlOperation for StreamingOperation<ResponseData, Variables>
where ResponseData: DeserializeOwned, Variables: Serialize,

Available on crate feature client-cynic only.
Source§

type Response = GraphQlResponse<ResponseData>

Source§

type Error = Error

Source§

fn decode(&self, response: Value) -> Result<Self::Response, Self::Error>

Implementors§