Struct async_graphql_actix_web::WSSubscription [−][src]
pub struct WSSubscription<Query, Mutation, Subscription, F> { /* fields omitted */ }
Expand description
Actor for subscription via websocket
Implementations
impl<Query, Mutation, Subscription> WSSubscription<Query, Mutation, Subscription, fn(_: Value) -> Ready<Result<Data>>> where
Query: ObjectType + 'static,
Mutation: ObjectType + 'static,
Subscription: SubscriptionType + 'static,
[src]
impl<Query, Mutation, Subscription> WSSubscription<Query, Mutation, Subscription, fn(_: Value) -> Ready<Result<Data>>> where
Query: ObjectType + 'static,
Mutation: ObjectType + 'static,
Subscription: SubscriptionType + 'static,
[src]pub fn start<T>(
schema: Schema<Query, Mutation, Subscription>,
request: &HttpRequest,
stream: T
) -> Result<HttpResponse, Error> where
T: Stream<Item = Result<Bytes, PayloadError>> + 'static,
[src]
pub fn start<T>(
schema: Schema<Query, Mutation, Subscription>,
request: &HttpRequest,
stream: T
) -> Result<HttpResponse, Error> where
T: Stream<Item = Result<Bytes, PayloadError>> + 'static,
[src]Start an actor for subscription connection via websocket.
impl<Query, Mutation, Subscription, F, R> WSSubscription<Query, Mutation, Subscription, F> where
Query: ObjectType + 'static,
Mutation: ObjectType + 'static,
Subscription: SubscriptionType + 'static,
F: FnOnce(Value) -> R + Unpin + Send + 'static,
R: Future<Output = Result<Data>> + Send + 'static,
[src]
impl<Query, Mutation, Subscription, F, R> WSSubscription<Query, Mutation, Subscription, F> where
Query: ObjectType + 'static,
Mutation: ObjectType + 'static,
Subscription: SubscriptionType + 'static,
F: FnOnce(Value) -> R + Unpin + Send + 'static,
R: Future<Output = Result<Data>> + Send + 'static,
[src]pub fn start_with_initializer<T>(
schema: Schema<Query, Mutation, Subscription>,
request: &HttpRequest,
stream: T,
initializer: F
) -> Result<HttpResponse, Error> where
T: Stream<Item = Result<Bytes, PayloadError>> + 'static,
F: FnOnce(Value) -> R + Unpin + Send + 'static,
R: Future<Output = Result<Data>> + Send + 'static,
[src]
pub fn start_with_initializer<T>(
schema: Schema<Query, Mutation, Subscription>,
request: &HttpRequest,
stream: T,
initializer: F
) -> Result<HttpResponse, Error> where
T: Stream<Item = Result<Bytes, PayloadError>> + 'static,
F: FnOnce(Value) -> R + Unpin + Send + 'static,
R: Future<Output = Result<Data>> + Send + 'static,
[src]Start an actor for subscription connection via websocket with an initialization function.
Trait Implementations
impl<Query, Mutation, Subscription, F, R> Actor for WSSubscription<Query, Mutation, Subscription, F> where
Query: ObjectType + 'static,
Mutation: ObjectType + 'static,
Subscription: SubscriptionType + 'static,
F: FnOnce(Value) -> R + Unpin + Send + 'static,
R: Future<Output = Result<Data>> + Send + 'static,
[src]
impl<Query, Mutation, Subscription, F, R> Actor for WSSubscription<Query, Mutation, Subscription, F> where
Query: ObjectType + 'static,
Mutation: ObjectType + 'static,
Subscription: SubscriptionType + 'static,
F: FnOnce(Value) -> R + Unpin + Send + 'static,
R: Future<Output = Result<Data>> + Send + 'static,
[src]type Context = WebsocketContext<Self>
type Context = WebsocketContext<Self>
Actor execution context type
fn stopping(&mut self, ctx: &mut Self::Context) -> Running
[src]
fn stopping(&mut self, ctx: &mut Self::Context) -> Running
[src]Called after an actor is in Actor::Stopping
state. Read more
fn start(self) -> Addr<Self> where
Self: Actor<Context = Context<Self>>,
[src]
fn start(self) -> Addr<Self> where
Self: Actor<Context = Context<Self>>,
[src]Start a new asynchronous actor, returning its address. Read more
fn start_default() -> Addr<Self> where
Self: Actor<Context = Context<Self>> + Default,
[src]
fn start_default() -> Addr<Self> where
Self: Actor<Context = Context<Self>> + Default,
[src]Construct and start a new asynchronous actor, returning its address. Read more
impl<Query, Mutation, Subscription, F, R> StreamHandler<Result<Message, ProtocolError>> for WSSubscription<Query, Mutation, Subscription, F> where
Query: ObjectType + 'static,
Mutation: ObjectType + 'static,
Subscription: SubscriptionType + 'static,
F: FnOnce(Value) -> R + Unpin + Send + 'static,
R: Future<Output = Result<Data>> + Send + 'static,
[src]
impl<Query, Mutation, Subscription, F, R> StreamHandler<Result<Message, ProtocolError>> for WSSubscription<Query, Mutation, Subscription, F> where
Query: ObjectType + 'static,
Mutation: ObjectType + 'static,
Subscription: SubscriptionType + 'static,
F: FnOnce(Value) -> R + Unpin + Send + 'static,
R: Future<Output = Result<Data>> + Send + 'static,
[src]fn handle(
&mut self,
msg: Result<Message, ProtocolError>,
ctx: &mut Self::Context
)
[src]
fn handle(
&mut self,
msg: Result<Message, ProtocolError>,
ctx: &mut Self::Context
)
[src]Method is called for every message received by this Actor
fn started(&mut self, ctx: &mut Self::Context)
[src]
fn started(&mut self, ctx: &mut Self::Context)
[src]Method is called when stream get polled first time.
fn finished(&mut self, ctx: &mut Self::Context)
[src]
fn finished(&mut self, ctx: &mut Self::Context)
[src]Method is called when stream finishes. Read more
fn add_stream<S>(fut: S, ctx: &mut Self::Context) -> SpawnHandle where
S: Stream<Item = I> + 'static,
I: 'static,
Self::Context: AsyncContext<Self>,
[src]
fn add_stream<S>(fut: S, ctx: &mut Self::Context) -> SpawnHandle where
S: Stream<Item = I> + 'static,
I: 'static,
Self::Context: AsyncContext<Self>,
[src]This method register stream to an actor context and
allows to handle Stream
in similar way as normal actor messages. Read more
Auto Trait Implementations
impl<Query, Mutation, Subscription, F> !RefUnwindSafe for WSSubscription<Query, Mutation, Subscription, F>
impl<Query, Mutation, Subscription, F> Send for WSSubscription<Query, Mutation, Subscription, F> where
F: Send,
Mutation: Send + Sync,
Query: Send + Sync,
Subscription: Send + Sync,
F: Send,
Mutation: Send + Sync,
Query: Send + Sync,
Subscription: Send + Sync,
impl<Query, Mutation, Subscription, F> Sync for WSSubscription<Query, Mutation, Subscription, F> where
F: Sync,
Mutation: Send + Sync,
Query: Send + Sync,
Subscription: Send + Sync,
F: Sync,
Mutation: Send + Sync,
Query: Send + Sync,
Subscription: Send + Sync,
impl<Query, Mutation, Subscription, F> Unpin for WSSubscription<Query, Mutation, Subscription, F> where
F: Unpin,
F: Unpin,
impl<Query, Mutation, Subscription, F> !UnwindSafe for WSSubscription<Query, Mutation, Subscription, F>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,