|
5 | 5 | <!-- prettier-ignore-start --> |
6 | 6 |
|
7 | 7 | [](https://crates.io/crates/actix-web-lab) |
8 | | -[](https://docs.rs/actix-web-lab/0.24.2) |
| 8 | +[](https://docs.rs/actix-web-lab/0.24.3) |
9 | 9 |  |
10 | 10 | <br /> |
11 | | -[](https://deps.rs/crate/actix-web-lab/0.24.2) |
| 11 | +[](https://deps.rs/crate/actix-web-lab/0.24.3) |
12 | 12 | [](https://crates.io/crates/actix-web-lab) |
13 | 13 | [](https://codecov.io/gh/robjtede/actix-web-lab) |
14 | 14 |
|
|
20 | 20 |
|
21 | 21 | ### Responders |
22 | 22 |
|
23 | | -- `Csv`: efficient CSV streaming [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/respond/struct.Csv.html) |
24 | | -- `NdJson`: efficient NDJSON streaming [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/respond/struct.NdJson.html) |
25 | | -- `DisplayStream`: efficient line-by-line `Display` streaming [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/respond/struct.DisplayStream.html) |
| 23 | +- `Csv`: efficient CSV streaming [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/respond/struct.Csv.html) |
| 24 | +- `NdJson`: efficient NDJSON streaming [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/respond/struct.NdJson.html) |
| 25 | +- `DisplayStream`: efficient line-by-line `Display` streaming [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/respond/struct.DisplayStream.html) |
26 | 26 | - `Html`: (graduated 🎉) basic string wrapper that responds with HTML Content-Type [(docs)](https://docs.rs/actix-web/4/actix_web/web/struct.Html.html) |
27 | | -- `Cbor`: basic CBOR format wrapper with appropriate Content-Type [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/respond/struct.Cbor.html) |
28 | | -- `MessagePack`: basic MessagePack format wrapper with appropriate Content-Type [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/respond/struct.MessagePack.html) |
29 | | -- `Sse`: semantic server-sent events (SSE) responder with a channel-like interface [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/sse/index.html) |
| 27 | +- `Cbor`: basic CBOR format wrapper with appropriate Content-Type [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/respond/struct.Cbor.html) |
| 28 | +- `MessagePack`: basic MessagePack format wrapper with appropriate Content-Type [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/respond/struct.MessagePack.html) |
| 29 | +- `Sse`: semantic server-sent events (SSE) responder with a channel-like interface [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/sse/index.html) |
30 | 30 |
|
31 | 31 | ### Middleware |
32 | 32 |
|
33 | 33 | - `from_fn`: (graduated 🎉) use an async function as a middleware [(docs)](https://docs.rs/actix-web/4/actix_web/middleware/fn.from_fn.html) |
34 | | -- `map_response`: use an async function to modify the response [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/middleware/fn.map_response.html) |
35 | | -- `map_response_body`: use an async function to modify the response body [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/middleware/fn.map_response_body.html) |
36 | | -- `RedirectHttps`: middleware to redirect traffic to HTTPS if connection is insecure with optional HSTS [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/middleware/struct.RedirectHttps.html) |
37 | | -- `redirect_to_www`: function middleware to redirect traffic to `www.` if not already there [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/middleware/fn.redirect_to_www.html) |
38 | | -- `redirect_to_non_www`: function middleware to redirect traffic to `www.` if not already there [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/middleware/fn.redirect_to_non_www.html) |
39 | | -- `ConditionOption`: conditional middleware helper [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/middleware/struct.ConditionOption.html) |
40 | | -- `ErrorHandlers`: alternative error handler middleware with simpler interface [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/middleware/struct.ErrorHandlers.html) |
41 | | -- `NormalizePath`: alternative path normalizing middleware with redirect option [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/middleware/struct.NormalizePath.html) |
42 | | -- `CatchPanic`: catch panics in wrapped handlers and middleware, returning empty 500 responses [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/middleware/struct.CatchPanic.html) |
43 | | -- `PanicReporter`: catch panics in wrapped handlers and middleware, returning empty 500 responses [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/middleware/struct.PanicReporter.html) |
44 | | -- `LoadShed`: sheds load when the inner service isn't ready [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/middleware/struct.LoadShed.html) |
| 34 | +- `map_response`: use an async function to modify the response [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/middleware/fn.map_response.html) |
| 35 | +- `map_response_body`: use an async function to modify the response body [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/middleware/fn.map_response_body.html) |
| 36 | +- `RedirectHttps`: middleware to redirect traffic to HTTPS if connection is insecure with optional HSTS [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/middleware/struct.RedirectHttps.html) |
| 37 | +- `redirect_to_www`: function middleware to redirect traffic to `www.` if not already there [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/middleware/fn.redirect_to_www.html) |
| 38 | +- `redirect_to_non_www`: function middleware to redirect traffic to `www.` if not already there [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/middleware/fn.redirect_to_non_www.html) |
| 39 | +- `ConditionOption`: conditional middleware helper [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/middleware/struct.ConditionOption.html) |
| 40 | +- `ErrorHandlers`: alternative error handler middleware with simpler interface [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/middleware/struct.ErrorHandlers.html) |
| 41 | +- `NormalizePath`: alternative path normalizing middleware with redirect option [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/middleware/struct.NormalizePath.html) |
| 42 | +- `CatchPanic`: catch panics in wrapped handlers and middleware, returning empty 500 responses [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/middleware/struct.CatchPanic.html) |
| 43 | +- `PanicReporter`: catch panics in wrapped handlers and middleware, returning empty 500 responses [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/middleware/struct.PanicReporter.html) |
| 44 | +- `LoadShed`: sheds load when the inner service isn't ready [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/middleware/struct.LoadShed.html) |
45 | 45 |
|
46 | 46 | ### Extractors |
47 | 47 |
|
48 | | -- `LazyData`: app data/state initialized on first use [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/extract/struct.LazyData.html) |
49 | | -- `SwapData`: app data/state that can be replaced at runtime (alternative to `Data<RwLock<T>>`) [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/extract/struct.SwapData.html) |
50 | | -- `LocalData`: app data/state that uses an `Rc` internally, avoiding atomic overhead (alternative to `Data<RwLock<T>>`) [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/extract/struct.LocalData.html) |
| 48 | +- `LazyData`: app data/state initialized on first use [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/extract/struct.LazyData.html) |
| 49 | +- `SwapData`: app data/state that can be replaced at runtime (alternative to `Data<RwLock<T>>`) [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/extract/struct.SwapData.html) |
| 50 | +- `LocalData`: app data/state that uses an `Rc` internally, avoiding atomic overhead (alternative to `Data<RwLock<T>>`) [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/extract/struct.LocalData.html) |
51 | 51 | - `ThinData`: (graduated 🎉) app data/state for cheaply-cloned types [(docs)](https://docs.rs/actix-web/4/actix_web/web/struct.ThinData.html) |
52 | | -- `Json`: simplified JSON extractor with const-generic payload limits [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/extract/struct.Json.html) |
53 | | -- `Path`: simplified path parameter extractor that supports destructuring [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/extract/struct.Path.html) |
54 | | -- `Query`: simplified query-string extractor that can also collect multi-value items [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/extract/struct.Query.html) |
55 | | -- `RequestSignature`: wraps an extractor and calculates a request signature alongside [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/extract/struct.RequestSignature.html) |
56 | | -- `BodyLimit`: wraps a body extractor and prevents DoS attacks by limiting payload size [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/extract/struct.BodyLimit.html) |
57 | | -- `Bytes`: simplified Bytes extractor with const-generic limits [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/extract/struct.Bytes.html) |
58 | | -- `UrlEncodedForm`: URL-encoded form extractor with const-generic payload size limit [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/extract/struct.UrlEncodedForm.html) |
59 | | -- `Host`: Host information taken from either URL or Host header [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/extract/struct.Host.html) |
| 52 | +- `Json`: simplified JSON extractor with const-generic payload limits [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/extract/struct.Json.html) |
| 53 | +- `Path`: simplified path parameter extractor that supports destructuring [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/extract/struct.Path.html) |
| 54 | +- `Query`: simplified query-string extractor that can also collect multi-value items [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/extract/struct.Query.html) |
| 55 | +- `RequestSignature`: wraps an extractor and calculates a request signature alongside [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/extract/struct.RequestSignature.html) |
| 56 | +- `BodyLimit`: wraps a body extractor and prevents DoS attacks by limiting payload size [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/extract/struct.BodyLimit.html) |
| 57 | +- `Bytes`: simplified Bytes extractor with const-generic limits [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/extract/struct.Bytes.html) |
| 58 | +- `UrlEncodedForm`: URL-encoded form extractor with const-generic payload size limit [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/extract/struct.UrlEncodedForm.html) |
| 59 | +- `Host`: Host information taken from either URL or Host header [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/extract/struct.Host.html) |
60 | 60 |
|
61 | 61 | ### Macros |
62 | 62 |
|
63 | | -- `FromRequest`: Derive macro to implement `FromRequest` on an aggregate struct of other extractors [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/derive.FromRequest.html) |
| 63 | +- `FromRequest`: Derive macro to implement `FromRequest` on an aggregate struct of other extractors [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/derive.FromRequest.html) |
64 | 64 |
|
65 | 65 | ### Headers |
66 | 66 |
|
67 | | -- `CacheControl`: Cache-Control typed header with support for modern directives [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/header/struct.CacheControl.html) |
68 | | -- `ClearSiteData`: Clear-Site-Data typed header [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/header/struct.ClearSiteData.html) |
69 | | -- `ContentLength`: Content-Length typed header [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/header/struct.ContentLength.html) |
70 | | -- `Forwarded`: Proxy and original client info [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/header/struct.Forwarded.html) |
71 | | -- `StrictTransportSecurity`: Strict-Transport-Security (HSTS) configuration [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/header/struct.StrictTransportSecurity.html) |
| 67 | +- `CacheControl`: Cache-Control typed header with support for modern directives [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/header/struct.CacheControl.html) |
| 68 | +- `ClearSiteData`: Clear-Site-Data typed header [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/header/struct.ClearSiteData.html) |
| 69 | +- `ContentLength`: Content-Length typed header [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/header/struct.ContentLength.html) |
| 70 | +- `Forwarded`: Proxy and original client info [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/header/struct.Forwarded.html) |
| 71 | +- `StrictTransportSecurity`: Strict-Transport-Security (HSTS) configuration [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/header/struct.StrictTransportSecurity.html) |
72 | 72 |
|
73 | 73 | ### Body Types |
74 | 74 |
|
75 | | -- `channel`: a simple channel-like body type with a sender side that can be used from another thread [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/body/fn.channel.html) |
76 | | -- `writer`: a simple `AsyncWrite` body type [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/body/fn.writer.html) |
| 75 | +- `channel`: a simple channel-like body type with a sender side that can be used from another thread [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/body/fn.channel.html) |
| 76 | +- `writer`: a simple `AsyncWrite` body type [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/body/fn.writer.html) |
77 | 77 |
|
78 | 78 | ### Services |
79 | 79 |
|
80 | 80 | - `Redirect`: (graduated 🎉) simple redirects [(docs)](https://docs.rs/actix-web/4/actix_web/web/struct.Redirect.html) |
81 | | -- `spa`: Easy Single-page Application (SPA) service [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/web/fn.spa.html) |
| 81 | +- `spa`: Easy Single-page Application (SPA) service [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/web/fn.spa.html) |
82 | 82 |
|
83 | 83 | ### Route Guards |
84 | 84 |
|
85 | 85 | - `Acceptable`: (graduated 🎉) verifies that an `Accept` header is present and it contains a compatible MIME type [(docs)](https://docs.rs/actix-web/4/actix_web/guard/struct.Acceptable.html) |
86 | 86 |
|
87 | 87 | ### Test Utilities |
88 | 88 |
|
89 | | -- `test_request`: construct `TestRequest` using an HTTP-like DSL [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/test/macro.test_request.html) |
90 | | -- `assert_response_matches`: quickly write tests that check various parts of a `ServiceResponse` [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/test/macro.assert_response_matches.html) |
| 89 | +- `test_request`: construct `TestRequest` using an HTTP-like DSL [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/test/macro.test_request.html) |
| 90 | +- `assert_response_matches`: quickly write tests that check various parts of a `ServiceResponse` [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/test/macro.assert_response_matches.html) |
91 | 91 |
|
92 | 92 | ### Other Utilities |
93 | 93 |
|
94 | | -- `fork_request_payload`: effectively clone a request payload [(docs)](https://docs.rs/actix-web-lab/0.24.2/actix_web_lab/util/fn.fork_request_payload.html) |
| 94 | +- `fork_request_payload`: effectively clone a request payload [(docs)](https://docs.rs/actix-web-lab/0.24.3/actix_web_lab/util/fn.fork_request_payload.html) |
95 | 95 |
|
96 | 96 | ## Things To Know About This Crate |
97 | 97 |
|
|
0 commit comments