(path: web::Path<String>)
| 56 | } |
| 57 | |
| 58 | async fn streaming_response(path: web::Path<String>) -> HttpResponse { |
| 59 | let name = path.into_inner(); |
| 60 | |
| 61 | HttpResponse::Ok() |
| 62 | .content_type(ContentType::plaintext()) |
| 63 | .streaming(stream! { |
| 64 | yield Ok::<_, Infallible>(web::Bytes::from("Hello ")); |
| 65 | yield Ok::<_, Infallible>(web::Bytes::from(name)); |
| 66 | yield Ok::<_, Infallible>(web::Bytes::from("!")); |
| 67 | }) |
| 68 | } |
| 69 | |
| 70 | /// handler with path parameters like `/user/{name}` |
| 71 | async fn with_param(req: HttpRequest, Path((name,)): Path<(String,)>) -> HttpResponse { |
nothing calls this directly
no outgoing calls
no test coverage detected