Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: `tokio` and `bincode`: reading from a socket
I have a UnixStream
socket in an application using tokio
. I also have some struct
s that use bincode
's Encode
and Decode
traits. I know that bincode
handles the length of variable-length fields (like String
s), but I don't think the sockets do. If I don't read a full struct
from the socket, I doubt it'll decode()
properly. How do I read from a tokio
socket, such that I can be sure that I've read a full struct
?
Edit:
Does bincode
maybe have a way to automatically decode()
directly from a tokio
socket?
6 posts - 4 participants
🏷️ rust_feed