pub fn colliders(&mut self) -> Result<Vec<BoxDimensions>, Box<dyn std::error::Error>> {
let tcp = Self::tcp()?;
let mut reader = BufReader::new(&tcp);
let mut writer = BufWriter::new(&tcp);
writer.write(&[PacketType::FetchCollidersPacket as u8])?;
writer.write_all(&serialize(FetchColliders::new())?)?;
writer.flush();
let vec: Vec<BoxDimensions> = deserialize(reader)?;
Ok(vec.clone())
}
On both 1.0, and 2.0, I get an "unexpected eof" error, even though I confirmed that after flushing the writer, I can in fact read the struct with reader.read_to_end; I even tried just saving the result of that function to a vec and then passing it to bincode::decode_from_slice , but I get the same error.
struct:
deserialization function:
function that calls it:
On both 1.0, and 2.0, I get an "unexpected eof" error, even though I confirmed that after flushing the writer, I can in fact read the struct with
reader.read_to_end
; I even tried just saving the result of that function to a vec and then passing it tobincode::decode_from_slice
, but I get the same error.