While doing some testing in the compiler where I wanted to set up some VM state and then execute a program on that state, I realized that there is no currently public API that allows one to access the state of the process to do so, short of using the internals feature flag of the crate.
Rather than requiring the use of that flag, this commit instead makes public the [Process] struct, but with all of its fields private unless the internals flag is enabled. This makes it possible to use the public APIs of the various traits implemented by Process to interact with it in a more fine-grained fashion.
It is still expected that most people will use the execute or execute_iter APIs, but this makes it possible to take control over that yourself when necessary/useful. I should also note that we were making the [Process] struct visible for ourselves under #[cfg(test)], so it is clearly useful in certain cases (namely testing).
While doing some testing in the compiler where I wanted to set up some VM state and then execute a program on that state, I realized that there is no currently public API that allows one to access the state of the process to do so, short of using the
internals
feature flag of the crate.Rather than requiring the use of that flag, this commit instead makes public the [Process] struct, but with all of its fields private unless the
internals
flag is enabled. This makes it possible to use the public APIs of the various traits implemented byProcess
to interact with it in a more fine-grained fashion.It is still expected that most people will use the
execute
orexecute_iter
APIs, but this makes it possible to take control over that yourself when necessary/useful. I should also note that we were making the [Process] struct visible for ourselves under#[cfg(test)]
, so it is clearly useful in certain cases (namely testing).