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
Is your feature request related to a problem? Please describe.
I'm using warp for develop websocket server. I selected warp for web framework other than axum, actix. It's concise!.
I thought about using tokio-tungstenite. but it had some problem with handling http request.
I'm using warp very well but there is only one thing that it's ugly to write code for branching websocket message type.
Now it provides some functions like to_str() to know the message type but I think enum is better like other framework.
Describe the solution you'd like
Provide enum type for websocket message type.
Describe alternatives you've considered
I tried some other framework but it's not concise as warp.
tokio-tungstenite has not much feature as warp.
Additional context
I see the comments in the code that it will provide enum when rust supports non-exhaustive stabilized.
I don't understand that why websocket types should be non-exhaustive.
If it's hard to implement, I think it's okay to just exposure tungstenite module.
Thanks!
The text was updated successfully, but these errors were encountered:
I don't understand that why websocket types should be non-exhaustive.
New frame types are allowed to be added, but if we made an exhaustive enum (such that you could write a match that check for every type), then when we added support for a new frame in the library, that would break your code.
New frame types are allowed to be added, but if we made an exhaustive enum (such that you could write a match that check for every type), then when we added support for a new frame in the library, that would break your code.
Quite a while back I made this PR: #903 (not realizing at the time that it was a duplicate already).
The concern about matching the enum is addressed by making it #[non_exhaustive].
Is your feature request related to a problem? Please describe.
I'm using warp for develop websocket server. I selected warp for web framework other than axum, actix. It's concise!.
I thought about using tokio-tungstenite. but it had some problem with handling http request.
I'm using warp very well but there is only one thing that it's ugly to write code for branching websocket message type.
Now it provides some functions like
to_str()
to know the message type but I think enum is better like other framework.Describe the solution you'd like
Provide enum type for websocket message type.
Describe alternatives you've considered
I tried some other framework but it's not concise as warp.
tokio-tungstenite has not much feature as warp.
Additional context
I see the comments in the code that it will provide enum when rust supports non-exhaustive stabilized.
I don't understand that why websocket types should be non-exhaustive.
If it's hard to implement, I think it's okay to just exposure tungstenite module.
Thanks!
The text was updated successfully, but these errors were encountered: