Expand description
The ServiceExt::map
combinator returns Map
, which extends a
service with a specified closure from the modifying the Service::Response
.
For an asynchronous version of this combinator see then module.
§Example
use burger::*;
let svc = service_fn(|x: u32| async move { x.to_string() }).map(|x: String| x.parse());
let response: usize = svc.oneshot(32).await.unwrap();
assert_eq!(response, 32);
§Load
Load
measurements defer to the inner service.
Structs§
- A wrapper
Service
for theServiceExt::map
combinator. - The
Service::Permit
type for Map.