Previously the Scan struct would track it's own state as well as allow external state operations. To do this though, it required a RefCell instance for the non-external state. This prevented the Scan struct from being fully used in scoped thread contexts without a Mutex or Arc.
Introduce the ScanEngine struct which contains all the same code as the Scan struct (rename) as before except for the internal state tracking.
Re-write the Scan struct to simply host the ScanEngine and a ScanState. This ensures the logic is the same as before, however, now we can completely drop the RefCell and make it much clearer for callers what we expect them to do.
Previously the Scan struct would track it's own state as well as allow external state operations. To do this though, it required a RefCell instance for the non-external state. This prevented the Scan struct from being fully used in scoped thread contexts without a Mutex or Arc.
Introduce the ScanEngine struct which contains all the same code as the Scan struct (rename) as before except for the internal state tracking.
Re-write the Scan struct to simply host the ScanEngine and a ScanState. This ensures the logic is the same as before, however, now we can completely drop the RefCell and make it much clearer for callers what we expect them to do.