html2pdf_api/traits/mod.rs
1//! Traits for abstraction and extensibility.
2//!
3//! This module provides traits that define the core abstractions used by
4//! the browser pool. These traits enable:
5//!
6//! - **Health monitoring**: [`Healthcheck`] for verifying browser health
7//! - **Extensibility**: Custom implementations for different use cases
8//!
9//! # Implementing Custom Health Checks
10//!
11//! While `TrackedBrowser` implements [`Healthcheck`]
12//! by default, you can implement custom health check logic:
13//!
14//! ```rust,ignore
15//! use html2pdf_api::{Healthcheck, Result, BrowserPoolError};
16//!
17//! struct MyCustomBrowser {
18//! // your fields
19//! }
20//!
21//! impl Healthcheck for MyCustomBrowser {
22//! fn ping(&self) -> Result<()> {
23//! // Your custom health check logic
24//! Ok(())
25//! }
26//! }
27//! ```
28
29mod healthcheck;
30
31pub use healthcheck::Healthcheck;