The docs of SerialPort::flush metion that:
Note that even if this method returns Ok, data may still be in hardware buffers on either side.
I don't fully understand how USB works.
Would it be enough to check if write_state == WriteState::Idle?
Also do I understand correctly that usb_device.poll(&mut [&mut serial_port]) needs to be called to make progress in flushing the hardware buffers?