You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
Why do you need your own implementation of IntoWs?
There is a blanket implementation provided for all AsyncRead + AsyncWrite + 'static.
Non-allocating buffers look a non-small change in rust-websocket architecture and is probably not worth pursuing now, given next-gen rust-websocket may be on the way.
Non-allocating buffers isn't the issue, the IntoWs implementation is because that controls the Upgrade object being returned which ultimately determines the MessageProtocol used. I want to swap out MessageProtocol but in order to use the rest of the infrastructure I have to provide IntoWs.
EDIT: I should also mention that replacement via Cargo doesn't make much sense as I'd only need to edit one or two files, forking makes more sense at that point.
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 theIntoWs
trait, it appears impossible to implement in a separate crate becauseUpgrade
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 whattokio
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?The text was updated successfully, but these errors were encountered: