-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extending the embedded documentation #440
Comments
@nickheyer thanks a lot. 1 simple way, would be to redirect the standard out/err before calling the runner to some memory buffer. |
I was thinking some form of callback function could be passed to the runner, and be called on standard output. |
@nickheyer maybe instead it would make more sense that you will provide a writer for out+err so those will be streamed to there. |
…ands to redirect out/err to provided streams #440
in dev branch 0.10.0 i've added the ability to provide a custom stream for out/err so you can get all that output instead of having it printed to stdout/err |
@sagiegurari This is awesome. It feels great to know that you'll continue to be actively maintaining this library and seeking improvements, as I invest time in projects that will likely be dependent on it. While I work on integrating this and replacing my very hacky stdout redirect workaround which used the Gag Crate ... I think a nice general objective for outlining rust implementation would be to provide example usage for |
…ands to redirect out/err to provided streams sagiegurari#440
Feature Description
I feel as though I have now read through every issue (current and closed), as well as every doc available to me. I honestly believe that the ability to embed this runtime/dsl into Rust is undervalued relative to the amount of supporting documentation. There isn't really a whole lot of offerings in this category, and you've made something really great - which is why it should capitalize on comprehensive documentation and rust extensibility.
That being said, my actual need for this documentation is to essentially do one "simple" (from my uninformed perspective) thing. I'd like a method or buffer I can tap into containing the stdout of the
runner::run_script*
methods.For example: If I
echo "Hello, World!"
, it is printed to my terminal. I'd like to use theHello, World!
dynamically within Rust application that executed the duckscript. A good use case would be redirecting output to a log, or via a websocket connection to a webapp, etc.A "nice" but maybe not possible implementation would be similar to how it's done with
context.variables
, where I can access the variables set in the duckscript after the duckscript was ran - and use that data as needed. Acontext.stdout
would be great. If that already exists, then I apologize in advance for my rant - I am somewhat new to Rust and it's documentation style.The text was updated successfully, but these errors were encountered: