Help - Rust Book Topic 16.2
โ Rust ๐ 2026-01-02 ๐ค surdeus ๐๏ธ 1Trying to implement the following paragraph stated in the topic 16.2 from Rust Book.
The try_recv method doesnโt block, but will instead return a Result<T, E> immediately: an Ok value holding a message if one is available and an Err value if there arenโt any messages this time. Using try_recv is useful if this thread has other work to do while waiting for messages: We could write a loop that calls try_recv every so often, handles a message if one is available, and otherwise does other work for a little while until checking again.
But the code did not result in receiving the message.
[messageEx]
(rajkrustlearn/messageEx.zip at main ยท rbalasakuri/rajkrustlearn ยท GitHub)
Need to know what's wrong in my code.
2 posts - 2 participants
๐ท๏ธ Rust_feed