aboutsummaryrefslogtreecommitdiff
path: root/rust/paasio/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'rust/paasio/README.md')
-rw-r--r--rust/paasio/README.md102
1 files changed, 102 insertions, 0 deletions
diff --git a/rust/paasio/README.md b/rust/paasio/README.md
new file mode 100644
index 0000000..03e5a4d
--- /dev/null
+++ b/rust/paasio/README.md
@@ -0,0 +1,102 @@
1# PaaS I/O
2
3Report network IO statistics.
4
5You are writing a [PaaS][], and you need a way to bill customers based
6on network and filesystem usage.
7
8Create a wrapper for network connections and files that can report IO
9statistics. The wrapper must report:
10
11- The total number of bytes read/written.
12- The total number of read/write operations.
13
14[PaaS]: http://en.wikipedia.org/wiki/Platform_as_a_service
15
16## Abstraction over Networks and Files
17
18Network and file operations are implemented in terms of the [`io::Read`][read] and [`io::Write`][write] traits. It will therefore be necessary to implement those traits for your types.
19
20[read]: https://doc.rust-lang.org/std/io/trait.Read.html
21[write]: https://doc.rust-lang.org/std/io/trait.Write.html
22
23
24## Rust Installation
25
26Refer to the [exercism help page][help-page] for Rust installation and learning
27resources.
28
29## Writing the Code
30
31Execute the tests with:
32
33```bash
34$ cargo test
35```
36
37All but the first test have been ignored. After you get the first test to
38pass, open the tests source file which is located in the `tests` directory
39and remove the `#[ignore]` flag from the next test and get the tests to pass
40again. Each separate test is a function with `#[test]` flag above it.
41Continue, until you pass every test.
42
43If you wish to run all ignored tests without editing the tests source file, use:
44
45```bash
46$ cargo test -- --ignored
47```
48
49To run a specific test, for example `some_test`, you can use:
50
51```bash
52$ cargo test some_test
53```
54
55If the specific test is ignored use:
56
57```bash
58$ cargo test some_test -- --ignored
59```
60
61To learn more about Rust tests refer to the [online test documentation][rust-tests]
62
63Make sure to read the [Modules][modules] chapter if you
64haven't already, it will help you with organizing your files.
65
66## Further improvements
67
68After you have solved the exercise, please consider using the additional utilities, described in the [installation guide](https://exercism.io/tracks/rust/installation), to further refine your final solution.
69
70To format your solution, inside the solution directory use
71
72```bash
73cargo fmt
74```
75
76To see, if your solution contains some common ineffective use cases, inside the solution directory use
77
78```bash
79cargo clippy --all-targets
80```
81
82## Submitting the solution
83
84Generally you should submit all files in which you implemented your solution (`src/lib.rs` in most cases). If you are using any external crates, please consider submitting the `Cargo.toml` file. This will make the review process faster and clearer.
85
86## Feedback, Issues, Pull Requests
87
88The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the rust track team are happy to help!
89
90If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
91
92[help-page]: https://exercism.io/tracks/rust/learning
93[modules]: https://doc.rust-lang.org/book/ch07-02-defining-modules-to-control-scope-and-privacy.html
94[cargo]: https://doc.rust-lang.org/book/ch14-00-more-about-cargo.html
95[rust-tests]: https://doc.rust-lang.org/book/ch11-02-running-tests.html
96
97## Source
98
99Brian Matsuo [https://github.com/bmatsuo](https://github.com/bmatsuo)
100
101## Submitting Incomplete Solutions
102It's possible to submit an incomplete solution so you can see how others have completed the exercise.