feat(tvix/eval): add EvalIO to public crate API
This lets users set the `io_handle` field on an `Evaluation`, which is then propagated to the VM. Change-Id: I616d7140724fb2b4db47c2ebf95451d5303a487a Reviewed-on: https://cl.tvl.fyi/c/depot/+/7566 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
This commit is contained in:
parent
25fc6b7c25
commit
c3c4d752c9
6 changed files with 42 additions and 14 deletions
|
|
@ -27,7 +27,7 @@ pub trait EvalIO {
|
|||
|
||||
/// Implementation of [`EvalIO`] that simply uses the equivalent
|
||||
/// standard library functions, i.e. does local file-IO.
|
||||
struct StdIO;
|
||||
pub struct StdIO;
|
||||
|
||||
impl EvalIO for StdIO {
|
||||
fn read_to_string(&self, path: PathBuf) -> Result<String, ErrorKind> {
|
||||
|
|
@ -41,7 +41,7 @@ impl EvalIO for StdIO {
|
|||
|
||||
/// Dummy implementation of [`EvalIO`], can be used in contexts where
|
||||
/// IO is not available but code should "pretend" that it is.
|
||||
struct DummyIO;
|
||||
pub struct DummyIO;
|
||||
|
||||
impl EvalIO for DummyIO {
|
||||
fn read_to_string(&self, _: PathBuf) -> Result<String, ErrorKind> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue