Module burger::leak

source ·
Expand description

The ServiceExt::leak combinator returns Leak, which extends the lifetime of the Service::Permit.

This can be only called on services within an Arc.

§Example

use burger::*;

let svc = Arc::new(service_fn(|x| async move { x + 4 })).leak();
let response = svc.oneshot(3u32).await;
assert_eq!(7, response);

§Load

The Load::load on Leak defers to the inner service.

Structs§