I have a UnixStream socket in an application using tokio. I also have some structs that use bincode's Encode and Decode traits. I know that bincode handles the length of variable-length fields (like Strings), 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?