pub struct GraphQLSubscription<Query, Mutation, Subscription, OnInit> { /* private fields */ }Expand description
A builder for websocket subscription actor.
Implementations
sourceimpl<Query, Mutation, Subscription> GraphQLSubscription<Query, Mutation, Subscription, fn(_: Value) -> Ready<Result<Data>>> where
    Query: ObjectType + 'static,
    Mutation: ObjectType + 'static,
    Subscription: SubscriptionType + 'static, 
 
impl<Query, Mutation, Subscription> GraphQLSubscription<Query, Mutation, Subscription, fn(_: Value) -> Ready<Result<Data>>> where
    Query: ObjectType + 'static,
    Mutation: ObjectType + 'static,
    Subscription: SubscriptionType + 'static, 
sourceimpl<Query, Mutation, Subscription, OnInit, OnInitFut> GraphQLSubscription<Query, Mutation, Subscription, OnInit> where
    Query: ObjectType + 'static,
    Mutation: ObjectType + 'static,
    Subscription: SubscriptionType + 'static,
    OnInit: Fn(Value) -> OnInitFut + Unpin + Send + 'static,
    OnInitFut: Future<Output = Result<Data>> + Send + 'static, 
 
impl<Query, Mutation, Subscription, OnInit, OnInitFut> GraphQLSubscription<Query, Mutation, Subscription, OnInit> where
    Query: ObjectType + 'static,
    Mutation: ObjectType + 'static,
    Subscription: SubscriptionType + 'static,
    OnInit: Fn(Value) -> OnInitFut + Unpin + Send + 'static,
    OnInitFut: Future<Output = Result<Data>> + Send + 'static, 
sourcepub fn with_data(self, data: Data) -> Self
 
pub fn with_data(self, data: Data) -> Self
Specify the initial subscription context data, usually you can get something from the incoming request to create it.
sourcepub fn on_connection_init<OnConnInit2, Fut>(
    self,
    callback: OnConnInit2
) -> GraphQLSubscription<Query, Mutation, Subscription, OnConnInit2> where
    OnConnInit2: Fn(Value) -> Fut + Unpin + Send + 'static,
    Fut: Future<Output = Result<Data>> + Send + 'static, 
 
pub fn on_connection_init<OnConnInit2, Fut>(
    self,
    callback: OnConnInit2
) -> GraphQLSubscription<Query, Mutation, Subscription, OnConnInit2> where
    OnConnInit2: Fn(Value) -> Fut + Unpin + Send + 'static,
    Fut: Future<Output = Result<Data>> + Send + 'static, 
Specify a callback function to be called when the connection is initialized.
You can get something from the payload of GQL_CONNECTION_INIT message to create Data.
The data returned by this callback function will be merged with the data
specified by [with_data].
sourcepub fn start<S>(
    self,
    request: &HttpRequest,
    stream: S
) -> Result<HttpResponse, Error> where
    S: Stream<Item = Result<Bytes, PayloadError>> + 'static, 
 
pub fn start<S>(
    self,
    request: &HttpRequest,
    stream: S
) -> Result<HttpResponse, Error> where
    S: Stream<Item = Result<Bytes, PayloadError>> + 'static, 
Start the subscription actor.
Auto Trait Implementations
impl<Query, Mutation, Subscription, OnInit> !RefUnwindSafe for GraphQLSubscription<Query, Mutation, Subscription, OnInit>
impl<Query, Mutation, Subscription, OnInit> Send for GraphQLSubscription<Query, Mutation, Subscription, OnInit> where
    Mutation: Send + Sync,
    OnInit: Send,
    Query: Send + Sync,
    Subscription: Send + Sync, 
impl<Query, Mutation, Subscription, OnInit> Sync for GraphQLSubscription<Query, Mutation, Subscription, OnInit> where
    Mutation: Send + Sync,
    OnInit: Sync,
    Query: Send + Sync,
    Subscription: Send + Sync, 
impl<Query, Mutation, Subscription, OnInit> Unpin for GraphQLSubscription<Query, Mutation, Subscription, OnInit> where
    OnInit: Unpin, 
impl<Query, Mutation, Subscription, OnInit> !UnwindSafe for GraphQLSubscription<Query, Mutation, Subscription, OnInit>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
    T: ?Sized, 
 
impl<T> BorrowMut<T> for T where
    T: ?Sized, 
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
 
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
 
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
 
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
 
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
    S: Into<Dispatch>, 
 
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
    S: Into<Dispatch>, 
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
 
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more