[][src]Struct actix_web::ws::WebsocketContext

pub struct WebsocketContext<A, S = ()> where
    A: Actor<Context = WebsocketContext<A, S>>, 
{ /* fields omitted */ }

Execution context for WebSockets actors

Methods

impl<A, S: 'static> WebsocketContext<A, S> where
    A: Actor<Context = Self>, 
[src]

Create a new Websocket context from a request and an actor

Create a new Websocket context

impl<A, S> WebsocketContext<A, S> where
    A: Actor<Context = Self>, 
[src]

Write payload

This is a low-level function that accepts framed messages that should be created using Frame::message(). If you want to send text or binary data you should prefer the text() or binary() convenience functions that handle the framing for you.

Shared application state

Incoming request

Returns drain future

Send text frame

Send binary frame

Send ping frame

Send pong frame

Send close frame

Check if connection still open

Handle of the running future

SpawnHandle is the handle returned by AsyncContext::spawn() method.

Trait Implementations

impl<A, S> WsWriter for WebsocketContext<A, S> where
    A: Actor<Context = Self>,
    S: 'static, 
[src]

Send text frame

Send binary frame

Send ping frame

Send pong frame

Send close frame

impl<A, S> ActorContext for WebsocketContext<A, S> where
    A: Actor<Context = Self>, 
[src]

Immediately stop processing incoming messages and switch to a stopping state Read more

Terminate actor execution

Actor execution state

impl<A, S> AsyncContext<A> for WebsocketContext<A, S> where
    A: Actor<Context = Self>, 
[src]

Spawn async future into context. Returns handle of the item, could be used for cancelling execution. Read more

Spawn future into the context. Stop processing any of incoming events until this future resolves. Read more

Cancel future. handle is a value returned by spawn method.

Return Address of the context

Check if context is paused (waiting for future completion or stopping)

This method register stream to an actor context and allows to handle Stream in similar way as normal actor messages. Read more

This method is similar to add_stream but it skips stream errors. Read more

Send message msg to self.

Send message msg to self after specified period of time. Returns spawn handle which could be used for cancellation. Notification get cancelled if context's stop method get called. Read more

Execute closure after specified period of time within same Actor and Context. Execution get cancelled if context's stop method get called. Read more

Spawns a job to execute the given closure periodically, at a specified fixed interval Read more

impl<A, M, S> ToEnvelope<A, M> for WebsocketContext<A, S> where
    A: Actor<Context = WebsocketContext<A, S>> + Handler<M>,
    M: ActixMessage + Send + 'static,
    M::Result: Send
[src]

Pack message into suitable envelope

impl<A, S> AsyncContextParts<A> for WebsocketContext<A, S> where
    A: Actor<Context = Self>, 
[src]

Auto Trait Implementations

impl<A, S = ()> !Send for WebsocketContext<A, S>

impl<A, S = ()> !Sync for WebsocketContext<A, S>

Blanket Implementations

impl<T> From for T
[src]

Performs the conversion.

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

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

Immutably borrows from an owned value. Read more

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

Mutably borrows from an owned value. Read more

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> Erased for T