create_pool_data

Function create_pool_data 

Source
pub fn create_pool_data(pool: SharedBrowserPool) -> BrowserPoolData
Expand description

Create Actix-web Data from an existing shared pool.

Use this when you already have a SharedBrowserPool and want to wrap it for Actix-web.

§Parameters

  • pool - The shared browser pool.

§Returns

BrowserPoolData ready for use with App::app_data().

§Example

use html2pdf_api::integrations::actix::create_pool_data;

let shared_pool = pool.into_shared();
let pool_data = create_pool_data(shared_pool);

App::new().app_data(pool_data)