Skip to content

Commit dc574fa

Browse files
committed
Lint.
1 parent a5056e8 commit dc574fa

File tree

2 files changed

+53
-64
lines changed

2 files changed

+53
-64
lines changed

Readme.md

+44-55
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Servlin
88
A modular HTTP server library in Rust.
99

1010
# Features
11-
1211
- `forbid(unsafe_code)`
1312
- Threaded request handlers:<br>
1413
`FnOnce(Request) -> Response + 'static + Clone + Send + Sync`
@@ -23,27 +22,24 @@ A modular HTTP server library in Rust.
2322
- Good test coverage (63%)
2423

2524
# Limitations
26-
2725
- New, not proven in production.
2826
- To do:
29-
- Request timeouts
30-
- `chunked` transfer-encoding for request bodies
31-
- gzip
32-
- brotli
33-
- TLS
34-
- automatically getting TLS certs via ACME
35-
- Drop idle connections when approaching connection limit.
36-
- Denial-of-Service mitigation: source throttling, minimum throughput
37-
- Complete functional test suite
38-
- Missing load tests
39-
- Disk space usage limits
27+
- Request timeouts
28+
- `chunked` transfer-encoding for request bodies
29+
- gzip
30+
- brotli
31+
- TLS
32+
- automatically getting TLS certs via ACME
33+
- Drop idle connections when approaching connection limit.
34+
- Denial-of-Service mitigation: source throttling, minimum throughput
35+
- Complete functional test suite
36+
- Missing load tests
37+
- Disk space usage limits
4038

4139
# Examples
42-
4340
Complete examples: [`examples/`](https://github.com/mleonhard/servlin/tree/main/examples).
4441

4542
Simple example:
46-
4743
```rust
4844
use serde::Deserialize;
4945
use serde_json::json;
@@ -93,11 +89,8 @@ executor.block_on(
9389
.spawn_and_join(request_handler)
9490
).unwrap();
9591
```
96-
9792
# Cargo Geiger Safety Report
98-
9993
```
100-
10194
Metric output format: x/y
10295
x = unsafe code used by the build
10396
y = total unsafe code found in the crate
@@ -236,68 +229,64 @@ Functions Expressions Impls Traits Methods Dependency
236229
101/547 7066/13995 105/153 3/6 187/326
237230
238231
```
239-
240232
# Alternatives
241-
242233
See [rust-webserver-comparison.md](https://github.com/mleonhard/servlin/blob/main/rust-webserver-comparison.md).
243234

244235
# Changelog
245-
246236
- v0.7.0 2025-01-03
247-
- `log_request_and_response` to log `duration_ms` tag.
248-
- Fix typo in function name `Response::internal_server_errror_500`.
249-
- Close connection on 5xx error.
250-
- Acceptor thread to log errors, not panic.
251-
- Add [`Request::parse_url`].
252-
- Add [`Response::too_many_requests_429`].
253-
- Implement `Into<TagList>` for arrays.
237+
- `log_request_and_response` to log `duration_ms` tag.
238+
- Fix typo in function name `Response::internal_server_errror_500`.
239+
- Close connection on 5xx error.
240+
- Acceptor thread to log errors, not panic.
241+
- Add [`Request::parse_url`].
242+
- Add [`Response::too_many_requests_429`].
243+
- Implement `Into<TagList>` for arrays.
254244
- v0.6.0 2024-11-02
255-
- Remove `servlin::reexports` module.
256-
- Use `safina` v0.6.0.
245+
- Remove `servlin::reexports` module.
246+
- Use `safina` v0.6.0.
257247
- v0.5.1 2024-10-26 - Remove dependency on `once_cell`.
258248
- v0.5.0 2024-10-21 - Remove `LogFileWriterBuilder`.
259249
- v0.4.3 - Implement `From<Cow<'_, str>>` and `From<&Path>` for `TagValue`.
260250
- v0.4.2 - Implement `Seek` for `BodyReader`.
261251
- v0.4.1
262-
- Add `Request::opt_json`.
263-
- Implement `From<LoggerStoppedError>` for `Error`.
252+
- Add `Request::opt_json`.
253+
- Implement `From<LoggerStoppedError>` for `Error`.
264254
- v0.4.0
265-
- Changed `Response::json` to return `Result<Response, Error>`.
266-
- Changed `log_request_and_response` to return `Result`.
267-
- Added `Response::unprocessable_entity_422`.
255+
- Changed `Response::json` to return `Result<Response, Error>`.
256+
- Changed `log_request_and_response` to return `Result`.
257+
- Added `Response::unprocessable_entity_422`.
268258
- v0.3.2 - Fix bug in `Response::include_dir` redirects.
269259
- v0.3.1
270-
- Add `Response::redirect_301`
271-
- `Response::include_dir` to redirect from `/somedir` to `/somedir/` so relative URLs will work.
260+
- Add `Response::redirect_301`
261+
- `Response::include_dir` to redirect from `/somedir` to `/somedir/` so relative URLs will work.
272262
- v0.3.0 - Changed `Response::include_dir` to take `&Request` and look for `index.html` in dirs.
273263
- v0.2.0
274-
- Added:
275-
- `log_request_and_response` and other logging tooling
276-
- `Response::ok_200()`
277-
- `Response::unauthorized_401()`
278-
- `Response::forbidden_403()`
279-
- `Response::internal_server_errror_500()`
280-
- `Response::not_implemented_501()`
281-
- `Response::service_unavailable_503()`
282-
- `EventSender::is_connected()`
283-
- `PORT_env()`
284-
- Removed `print_log_response` and `RequestBody::length_is_known`
285-
- Changed `RequestBody::len` and `is_empty` to return `Option`.
286-
- Bugfixes
264+
- Added:
265+
- `log_request_and_response` and other logging tooling
266+
- `Response::ok_200()`
267+
- `Response::unauthorized_401()`
268+
- `Response::forbidden_403()`
269+
- `Response::internal_server_errror_500()`
270+
- `Response::not_implemented_501()`
271+
- `Response::service_unavailable_503()`
272+
- `EventSender::is_connected()`
273+
- `PORT_env()`
274+
- Removed `print_log_response` and `RequestBody::length_is_known`
275+
- Changed `RequestBody::len` and `is_empty` to return `Option`.
276+
- Bugfixes
287277
- v0.1.1 - Add `EventSender::unconnected`.
288278
- v0.1.0 - Rename library to Servlin.
289279

290280
# TO DO
291-
292281
- Fix limitations above
293282
- Support [HEAD](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD)
294283
responses that have Content-Length set and no body.
295284
- Add a server-wide limit on upload body size.
296285
- Limit disk usage for caching uploads.
297286
- Update `rust-webserver-comparison.md`
298-
- Add missing data
299-
- Add other servers from <https://www.arewewebyet.org/topics/frameworks/>
300-
- Rearrange
301-
- Generate geiger reports for each web server
287+
- Add missing data
288+
- Add other servers from <https://www.arewewebyet.org/topics/frameworks/>
289+
- Rearrange
290+
- Generate geiger reports for each web server
302291

303292
License: MIT OR Apache-2.0

src/lib.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,16 @@
102102
//!
103103
//! # Changelog
104104
//! - v0.7.0 2025-01-03
105-
//! - `log_request_and_response` to log `duration_ms` tag.
106-
//! - Fix typo in function name `Response::internal_server_errror_500`.
107-
//! - Close connection on 5xx error.
108-
//! - Acceptor thread to log errors, not panic.
109-
//! - Add [`Request::parse_url`].
110-
//! - Add [`Response::too_many_requests_429`].
111-
//! - Implement `Into<TagList>` for arrays.
105+
//! - `log_request_and_response` to log `duration_ms` tag.
106+
//! - Fix typo in function name `Response::internal_server_errror_500`.
107+
//! - Close connection on 5xx error.
108+
//! - Acceptor thread to log errors, not panic.
109+
//! - Add [`Request::parse_url`].
110+
//! - Add [`Response::too_many_requests_429`].
111+
//! - Implement `Into<TagList>` for arrays.
112112
//! - v0.6.0 2024-11-02
113-
//! - Remove `servlin::reexports` module.
114-
//! - Use `safina` v0.6.0.
113+
//! - Remove `servlin::reexports` module.
114+
//! - Use `safina` v0.6.0.
115115
//! - v0.5.1 2024-10-26 - Remove dependency on `once_cell`.
116116
//! - v0.5.0 2024-10-21 - Remove `LogFileWriterBuilder`.
117117
//! - v0.4.3 - Implement `From<Cow<'_, str>>` and `From<&Path>` for `TagValue`.

0 commit comments

Comments
 (0)