Skip to content

Impossible to implement async IntoWs? #198

Open
@bspeice

Description

@bspeice

My goal is to build an object-pool Codec implementation to avoid allocations for all the frames/messages that come through a websocket. However, despite server/mod.rs mentioning the IntoWs trait, it appears impossible to implement in a separate crate because Upgrade in upgrade/async.rs is a struct that I can't patch the implementation for. Thus, I'd be able to adapt the underlying stream (so having new exotic things beyond just what tokio provides), but the protocol details are hidden from other crates.

Am I understanding this correctly? And is that all the more reason for #180 or extracting WsUpgrade into a trait?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions