refactor(tvix/eval): use EvalIO::read_to_string in impure builtins
With this change, the behaviour of reading a string from a file path is controlled by the provided `EvalIO` structure. This is a huge step towards abstracting away I/O behaviour correctly. Change-Id: Ifde8e46cd863b16e0301dca45a434ad27560399f Reviewed-on: https://cl.tvl.fyi/c/depot/+/7567 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
This commit is contained in:
parent
c3c4d752c9
commit
0ef3c2fc2b
3 changed files with 21 additions and 38 deletions
|
|
@ -220,6 +220,11 @@ impl<'o> VM<'o> {
|
|||
self.chunk().get_span(self.frame().ip - 1)
|
||||
}
|
||||
|
||||
/// Access the I/O handle used for filesystem access in this VM.
|
||||
pub(crate) fn io(&self) -> &Box<dyn EvalIO> {
|
||||
&self.io_handle
|
||||
}
|
||||
|
||||
/// Returns the information needed to calculate the current span,
|
||||
/// but without performing that calculation.
|
||||
fn current_light_span(&self) -> LightSpan {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue