Module config

Module config 

Source
Expand description

Configuration for browser pool behavior and limits.

This module provides BrowserPoolConfig and BrowserPoolConfigBuilder for configuring pool size, browser lifecycle, and health monitoring parameters.

§Example

use std::time::Duration;
use html2pdf_api::BrowserPoolConfigBuilder;

let config = BrowserPoolConfigBuilder::new()
    .max_pool_size(10)
    .warmup_count(5)
    .browser_ttl(Duration::from_secs(7200))
    .build()
    .expect("Invalid configuration");

assert_eq!(config.max_pool_size, 10);
assert_eq!(config.warmup_count, 5);

§Environment Configuration

When the env-config feature is enabled, you can load configuration from environment variables and an optional app.env file:

use html2pdf_api::config::env::from_env;

let config = from_env()?;

See env module for available environment variables.

Modules§

env
Environment-based configuration loading.

Structs§

BrowserPoolConfig
Configuration for browser pool behavior and limits.
BrowserPoolConfigBuilder
Builder for BrowserPoolConfig with validation.