Comments (6)
Okay! It fixed the issue, it was just my inattention. Sorry for bothering you.
from message-io.
Hi, how are you compiling them? a simple cargo test
for me compile the example without errors
from message-io.
What is your rust version?
from message-io.
My rustc version: rustc 1.74.1 (a28077b28 2023-12-04)
And I'm not compiling your examples, I'm compiling my modified code - your examples indeed work as expected. I don't know what's wrong with mine though.
I'm doing this:
let (network_handler, network_listener) = message_io::node::split();
let (server, _) = network_handler.network().connect(message_io::network::Transport::FramedTcp, SERVER_ADDRESS).unwrap();
let mut network_thread = network_listener.for_each_async(move |node_event| match node_event {
message_io::node::NodeEvent::Network(net_event) => match net_event {
message_io::network::NetEvent::Connected(_, is_ok) => {
assert!(is_ok);
},
message_io::network::NetEvent::Message(_, data) => {
},
message_io::network::NetEvent::Disconnected(_) => {},
message_io::network::NetEvent::Accepted(_, _) => unreachable!()
},
message_io::node::NodeEvent::Signal(_) => {}
});
from message-io.
I've updated rust and now it returns a diffrent, but very similar error:
error[E0283]: type annotations needed for `NodeEvent<'_, S>`
--> src/client.rs:29:72
|
26 | ...work_listener) = message_io::node::split();
| ------------------------- type must be known at this point
...
29 | ...network_listener.for_each_async(move |node_event| match node_event {
| ^^^^^^^^^^
|
= note: cannot satisfy `_: Send`
note: required by a bound in `message_io::node::split`
--> /home/wojtek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/message-io-0.18.1/src/node.rs:180:17
|
180 | pub fn split<S: Send>() -> (NodeHandler<S>, NodeListener<S>) {
| ^^^^ required by this bound in `split`
help: consider giving this closure parameter an explicit type, where the type for type parameter `S` is specified
|
29 | let mut network_thread = network_listener.for_each_async(move |node_event: NodeEvent<'_, S>| match node_event {
| ++++++++++++++++++
from message-io.
You need to specify the signal type. You can see this in the examples, i.e, in the README example it's as follows (for an empty signal ()
type):
let (handler, listener) = node::split::<()>();
Please note that I can give support to the library itself. But I do not for external code.
from message-io.
Related Issues (20)
- Disconnecting badly acting client (endpoint) HOT 2
- Cancelling timed messages fails sometimes HOT 3
- Release 0.14.8
- Unable to connect with FramedTcp HOT 1
- Release v0.15.0 HOT 8
- Add support for Bevy ECS HOT 3
- Error compiling with only tcp feature enabled HOT 3
- Release 0.16.0 HOT 2
- Buymeacoffee badge is misspelled ("bymeacoffee") HOT 1
- ws can not receive text HOT 10
- Is it possible to limit max packet size when using FramedTcp transport? HOT 1
- Is it possible to create an UART adapter? HOT 3
- Not compiling on linux (ubuntu 22.04) HOT 2
- Scaling of a application HOT 6
- is there any possibility for multiple thread mio eventloop? HOT 1
- Feature Request: Accept WebSocket URLs with parameters. HOT 3
- client don't try reconnect HOT 2
- Trait implementation of adapters that cannot accept a socket address? HOT 3
- Build error with Tungstenite 0.22.0+ HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from message-io.