pub trait BrowserPoolActixExt {
// Required method
fn into_actix_data(self) -> BrowserPoolData;
}Expand description
Extension trait for BrowserPool with Actix-web helpers.
Provides convenient methods for integrating with Actix-web.
Required Methods§
Sourcefn into_actix_data(self) -> BrowserPoolData
fn into_actix_data(self) -> BrowserPoolData
Convert the pool into Actix-web Data wrapper.
This is equivalent to calling into_shared() and then wrapping
with web::Data::new().
§Example
ⓘ
use html2pdf_api::integrations::actix::BrowserPoolActixExt;
let pool = BrowserPool::builder()
.factory(Box::new(ChromeBrowserFactory::with_defaults()))
.build()?;
let pool_data = pool.into_actix_data();
HttpServer::new(move || {
App::new()
.app_data(pool_data.clone())
})