pub fn with_codec<S>(
        actor: A,
        stream: S,
        codec: Codec,
    ) -> 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));

        WebsocketContextFut::new(ctx, actor, mb, codec)
    }
/// Create a new Websocket context from a request, an actor, and a codec
Create a new Websocket context from a request, an actor, and a codec
Create a new Websocket context from a request an actor and a codec
pub fn with_codec<S>(
        actor: A,
        stream: S,
        codec: Codec,
    ) -> 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));
        WebsocketContextFut::new(ctx, actor, mb, codec)
    }
pub fn with_codec < S > ( actor : A , stream : S , codec : Codec , ) -> 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 ) ) ; WebsocketContextFut :: new ( ctx , actor , mb , codec ) }
Create a new Websocket context from a request, an actor, and a codec
Create a new Websocket context from a request an actor and a codec
actor
A
stream
S
codec
Codec