Module rocket

Module rocket 

Source
Expand description

Rocket integration module.

Provides pre-built handlers and helpers for Rocket 0.5.x.

§Quick Start

use html2pdf_api::prelude::*;
use html2pdf_api::integrations::rocket::routes;

#[rocket::launch]
async fn launch() -> _ {
    let pool = init_browser_pool().await.unwrap();

    rocket::build()
        .manage(pool)
        .mount("/", routes())
}

§Available Exports

ExportDescription
routesGet all pre-built routes
pdf_from_urlHandler for URL-to-PDF
pdf_from_htmlHandler for HTML-to-PDF
pool_statsHandler for pool statistics
health_checkHandler for health check
readiness_checkHandler for readiness check
SharedPoolType alias for Arc<Mutex<BrowserPool>>

See crate::integrations::rocket for full documentation.

Re-exports§

pub use crate::integrations::rocket::*;