pub fn create_with_addr<S>(
        actor: A,
        stream: S,
    ) -> (Addr<A>, impl Stream<Item = Result<Bytes, Error>>)
    where
        A: StreamHandler<Result<Message, ProtocolError>>,
        S: Stream<Item = Result<Bytes, PayloadError>> + 'static,
    {
        let mb = Mailbox::default();
        let mut ctx = WebsocketContext {
            inner: ContextParts::new(mb.sender_producer()),
            messages: VecDeque::new(),
        };
        ctx.add_stream(WsStream::new(stream, Codec::new()));

        let addr = ctx.address();

        (addr, WebsocketContextFut::new(ctx, actor, mb, Codec::new()))
    }
/// Create a new Websocket context from a request and an actor.
///
/// Returns a pair, where the first item is an addr for the created actor,
/// and the second item is a stream intended to be set as part of the
/// response via `HttpResponseBuilder::streaming()`.
Create a new Websocket context from a request and an actor.
Returns a pair, where the first item is an addr for the created actor,
and the second item is a stream intended to be set as part of the
response via `HttpResponseBuilder::streaming()`.
Create a new Websocket context from a request and an actor . Returns a pair where the first item is an addr for the created actor and the second item is a stream intended to be set as part of the response via ` HttpResponseBuilder :: streaming () ` .
pub fn create_with_addr<S>(
        actor: A,
        stream: S,
    ) -> (Addr<A>, impl Stream<Item = Result<Bytes, Error>>)
    where
        A: StreamHandler<Result<Message, ProtocolError>>,
        S: Stream<Item = Result<Bytes, PayloadError>> + 'static,
    {
        let mb = Mailbox::default();
        let mut ctx = WebsocketContext {
            inner: ContextParts::new(mb.sender_producer()),
            messages: VecDeque::new(),
        };
        ctx.add_stream(WsStream::new(stream, Codec::new()));
        let addr = ctx.address();
        (addr, WebsocketContextFut::new(ctx, actor, mb, Codec::new()))
    }
pub fn create_with_addr < S > ( actor : A , stream : S , ) -> ( Addr < A > , impl Stream < Item = Result < Bytes , Error > > ) where A : StreamHandler < Result < Message , ProtocolError > > , S : Stream < Item = Result < Bytes , PayloadError > > + ' static , { let mb = Mailbox :: default ( ) ; let mut ctx = WebsocketContext { inner : ContextParts :: new ( mb . sender_producer ( ) ) , messages : VecDeque :: new ( ) , } ; ctx . add_stream ( WsStream :: new ( stream , Codec :: new ( ) ) ) ; let addr = ctx . address ( ) ; ( addr , WebsocketContextFut :: new ( ctx , actor , mb , Codec :: new ( ) ) ) }
Create a new Websocket context from a request and an actor.
Create a new Websocket context from a request and an actor .
actor
A
stream
S