Failure: Converted `read_test` to a poll-based function, it still loses state required to maintain the buffer location. There"s no way to make this code keep the state. We need to re-design the function to something completely different.
todo!("Convert `read_test` method to a polling function. It is NOT possible to pin the future on the stack and poll it. causes bug.")
usefutures::ready;
letthis=self.get_mut();
letmutw=0;
Poll::Ready(loop{
letread=ifthis.buffer.len()<SIZE
{
this.buffer.resize(SIZE,0);
letmutdone=0;
letmutr=0;
// XXX: V Same issue, runs the above code twice when re-polling after Pending. We need to make sure we jump back to this point in the code following a Pending poll to `stream.poll_read`, but I have no fucking clue how to do this? Eh...... We'll probably need to design the code differently. There is a lot of state that gets lost here and idk how to preserve it.... I hate this.