Struct async_graphql::http::WebSocket[][src]

pub struct WebSocket<S, F, Query, Mutation, Subscription> { /* fields omitted */ }

A GraphQL connection over websocket.

Reference.

Implementations

impl<S, Query, Mutation, Subscription> WebSocket<S, fn(_: Value) -> Ready<Result<Data>>, Query, Mutation, Subscription>[src]

#[must_use]pub fn new(
    schema: Schema<Query, Mutation, Subscription>,
    stream: S,
    protocol: Protocols
) -> Self
[src]

Create a new websocket.

impl<S, F, Query, Mutation, Subscription> WebSocket<S, F, Query, Mutation, Subscription>[src]

#[must_use]pub fn with_data(
    schema: Schema<Query, Mutation, Subscription>,
    stream: S,
    data_initializer: F,
    protocol: Protocols
) -> Self
[src]

Create a new websocket with a data initialization function.

This function, if present, will be called with the data sent by the client in the GQL_CONNECTION_INIT message. From that point on the returned data will be accessible to all requests.

Trait Implementations

impl<S, F, R, Query, Mutation, Subscription> Stream for WebSocket<S, F, Query, Mutation, Subscription> where
    S: Stream,
    S::Item: AsRef<[u8]>,
    F: FnOnce(Value) -> R + Send + 'static,
    R: Future<Output = Result<Data>> + Send + 'static,
    Query: ObjectType + 'static,
    Mutation: ObjectType + 'static,
    Subscription: SubscriptionType + 'static, 
[src]

type Item = WsMessage

Values yielded by the stream.

impl<'__pin, S, F, Query, Mutation, Subscription> Unpin for WebSocket<S, F, Query, Mutation, Subscription> where
    __Origin<'__pin, S, F, Query, Mutation, Subscription>: Unpin
[src]

Auto Trait Implementations

impl<S, F, Query, Mutation, Subscription> !RefUnwindSafe for WebSocket<S, F, Query, Mutation, Subscription>

impl<S, F, Query, Mutation, Subscription> Send for WebSocket<S, F, Query, Mutation, Subscription> where
    F: Send,
    Mutation: Send + Sync,
    Query: Send + Sync,
    S: Send,
    Subscription: Send + Sync

impl<S, F, Query, Mutation, Subscription> !Sync for WebSocket<S, F, Query, Mutation, Subscription>

impl<S, F, Query, Mutation, Subscription> !UnwindSafe for WebSocket<S, F, Query, Mutation, Subscription>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> FutureExt for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> StreamExt for T where
    T: Stream + ?Sized
[src]

impl<S> StreamExt for S where
    S: Stream + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]