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
First of all, thank you for maintaining such a great project! While testing the WebSocket functionality with the example code provided in the All in one: TCP, UDP and WebSocket echo server, I encountered a compilation error when enabling the websocket feature (or using default features).
The following compilation errors occur:
❯ cargo run
Compiling message-io v0.18.2
error[E0308]: mismatched types
--> /home/metaflow/.cargo/registry/src/index.crates.io-6f17d22bba15001f/message-io-0.18.2/src/adapters/ws.rs:138:42
|
138 | ... process_data(&data);| ------------ ^^^^^ expected `&[u8]`, found `&Payload`||| arguments to this functionare incorrect
|
= note: expected reference `&[u8]`
found reference `&Payload`
note: type parameter defined here
--> /home/metaflow/.cargo/registry/src/index.crates.io-6f17d22bba15001f/message-io-0.18.2/src/adapters/ws.rs:116:41
|
116 | fn receive(&self, mut process_data: impl FnMut(&[u8])) -> ReadStatus {
| ^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> /home/metaflow/.cargo/registry/src/index.crates.io-6f17d22bba15001f/message-io-0.18.2/src/adapters/ws.rs:165:47
|
165 |let message = Message::Binary(data.to_vec());
| --------------- ^^^^^^^^^^^^^ expected `Payload`, found `Vec<u8>`||| arguments to this enum variant are incorrect
|
= note: expected enum `Payload`
found struct `std::vec::Vec<u8>`
note: tuple variant defined here
--> /home/metaflow/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tungstenite-0.25.0/src/protocol/message.rs:159:5
|
159 | Binary(Payload),
| ^^^^^^
help: try wrapping the expression in`tungstenite::protocol::frame::Payload::Vec`|
165 |let message = Message::Binary(tungstenite::protocol::frame::Payload::Vec(data.to_vec()));
| +++++++++++++++++++++++++++++++++++++++++++ +
For more information about this error, try `rustc --explain E0308`.
error: could not compile `message-io` (lib) due to 2 previous errors
The text was updated successfully, but these errors were encountered:
Thanks for arising this. Yes, it was a change introduced by the tungstenite dependency that should be fixed here: 77858e5
I need to create another release with that fix. By now it should compile if you use the message-io dependency with the github path to the master branch.
First of all, thank you for maintaining such a great project! While testing the WebSocket functionality with the example code provided in the All in one: TCP, UDP and WebSocket echo server, I encountered a compilation error when enabling the websocket feature (or using default features).
The following compilation errors occur:
The text was updated successfully, but these errors were encountered: