BrowserPoolState

Type Alias BrowserPoolState 

Source
pub type BrowserPoolState<'r> = &'r State<SharedBrowserPool>;
Expand description

Type alias for Rocket State wrapper around the shared pool.

Use this type in your handler parameters:

#[get("/pdf")]
async fn handler(pool: BrowserPoolState<'_>) -> Result<Vec<u8>, Status> {
    let pool = pool.lock().unwrap();
    let browser = pool.get()?;
    // ...
}