[][src]Trait juniper_graphql_ws::Init

pub trait Init<S: ScalarValue, CtxT>: Unpin + 'static {
    type Error: Error;
    type Future: Future<Output = Result<ConnectionConfig<CtxT>, Self::Error>> + Send + 'static;
    fn init(self, params: Variables<S>) -> Self::Future;
}

Init defines the requirements for types that can provide connection configurations when ConnectionInit messages are received. Implementations are provided for ConnectionConfig and closures that meet the requirements.

Associated Types

type Error: Error[src]

The error that is returned on failure. The formatted error will be used as the contents of the "message" field sent back to the client.

type Future: Future<Output = Result<ConnectionConfig<CtxT>, Self::Error>> + Send + 'static[src]

The future configuration type.

Loading content...

Required methods

fn init(self, params: Variables<S>) -> Self::Future[src]

Returns a future for the configuration to use.

Loading content...

Implementors

impl<F, S, CtxT, Fut, E> Init<S, CtxT> for F where
    S: ScalarValue,
    F: FnOnce(Variables<S>) -> Fut + Unpin + 'static,
    Fut: Future<Output = Result<ConnectionConfig<CtxT>, E>> + Send + 'static,
    E: Error
[src]

type Error = E

type Future = Fut

impl<S: ScalarValue, CtxT: Unpin + Send + 'static> Init<S, CtxT> for ConnectionConfig<CtxT>[src]

type Error = Infallible

type Future = Ready<Result<Self, Self::Error>>

Loading content...