pub trait Init<S: ScalarValue, CtxT>: Unpin + 'static {
    type Error: Error;
    type Future: Future<Output = Result<ConnectionConfig<CtxT>, Self::Error>> + Send + 'static;

    // Required method
    fn init(self, params: Variables<S>) -> Self::Future;
}
Expand description

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.

Required Associated Types§

source

type Error: Error

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.

source

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

The future configuration type.

Required Methods§

source

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

Returns a future for the configuration to use.

Implementors§

source§

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,

§

type Error = E

§

type Future = Fut

source§

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