Conversation
Contributor
|
kaihsin
approved these changes
Sep 18, 2026
kaihsin
left a comment
Collaborator
There was a problem hiding this comment.
Can we instead of having multiple output enum type, just redirect std::io::Cursor to what you want to output? I think Cursor is flexible enough, just need to redirect that Cursor buffer to either stdout or file.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
StdoutObserver currently captures VM text only in memory. Add
buffered(),stdout(), andfile(File)constructors so callers can select memory capture, process stdout, or disk output using the same concrete observer type.Defaultandoutput() -> &[u8]remain compatible with existing callers; stdout/file destinations retain no extra memory copy and return an empty slice fromoutput().The caller controls file creation, truncation, and append options. Direct writes and observed effects use the selected destination, preserve UTF-8 bytes, and propagate I/O errors. Add explicit
flush(), API and guide documentation, and integration tests using real files and a child process to check stdout isolation.tempfileis a test-only dependency.This is a separate vihaco change related to QuEraComputing/stellarscope#134; it does not change Corvus or its JSON format.
Validation on macOS with Rust 1.96.0:
cargo test -p vihaco-stdlib(5 unit tests and 6 integration tests).cargo test --workspace --doc.cargo clippy --workspace --all-targets -- -D warnings.cargo fmt --all -- --checkandhawkeye check.cargo test --workspace --all-targets.