- Either read the "File Contents" from a file or place the text into a multi-line block
- Parse the contents
- Aggregate the time (last field)
- Report of total calls
- Report any error cases (non-200)
- Bonus points: report what line number the error occured on
GET /hello/world 200 2s
POST /create/obj 400 3s
PUT /update/world 500 6s
DELETE /end/times 200 3s
Total time: 14s
Total calls: 4
Errors:
POST /create/obj 400 3s
PUT /update/world 500 6s
Note: "domain" object is refering to an internal memory structure - not a string. Hint: either a Rust struct or enum.
- GET, POST, PUT, DELETE - should be a domain object
- 200, 400, 500 - should be a domain object
- Mutli-line strings (ref)
let shader = r#"
Hello,
How are you.
Nice to see you.
"#;
- Read from file (ref)
use std::fs;
let contents = fs::read_to_string(filename)
.expect("Something went wrong reading the file");
println!("With text:\n{}", contents);
-
Splitting a string on a character (ref)
-
Trim -
trim()
andtrim_matches()
will remove characters from the start and end of strings (ref)
"a12345a".trim_matches('a') == "12345"