rust-cookbook
rust-cookbook copied to clipboard
Cookbook ideas for std
EDITED I'm not sure what the different options are regarding stdio, so here are some suggestions
Current list:
- [x] Run an external command and process stdout
- [x] Run an external command passing it stdin and check for an error code
- [x] Run piped external commands
- [x] Measure elapsed time
- [x] Redirect both stdout and stderr of child process to the same file
- [x] Process child process output continuously
- [x] Get files in directory modified in the last 24 hours
- [ ] Implement FromStr
- [ ] Read Environment variable to find Configuration file
- [ ] Implement Display and Debug and Hash
@derekdreery thanks for the suggestions.
We already have Run an external command and process stdout example which is a little more advanced version of your 1'st suggestion. But I like the ideas 2-4.
How about combining the 2'nd and 3'rd suggestion into one and leaving the 4'th as is? Would you be interested in submitting PR for any of these?
Yeah I can do that
@derekdreery excellent :+1: . I took the liberty of updating the description into a tracking issue if there will be any other example ideas. Would you like to work on both of these examples or on a specific one (I'll mark them as WIP to avoid duplicated work)?
Yeah I can do both, might be a few days, it's late here :P.
Run an external command and process stdout doesn't currently have std listed as one of its crates. Should it be added?
to one extent or the other all of the examples will use std. we are adding it more to denote lack of any other crate in use (otherwise this would be just noise)
There are a ton of opportunities in std to add to the cookbook. There's boxed, error, ffi, file systems, networking, strings, time, primitives. We could write an entire chapter of fmt.
I'm going to try to think of some recipes that would showcase std.