Skip to main content

poli_page/
lib.rs

1#![forbid(unsafe_code)]
2#![warn(missing_docs)]
3#![warn(clippy::pedantic, clippy::cargo)]
4// Allow-list for pedantic/cargo lints: each entry is either a known
5// false-positive class or a constraint the SDK can't satisfy.
6#![allow(
7    // SDK modules name types after themselves by convention (Render, Documents).
8    clippy::module_name_repetitions,
9    // Blocking-module methods delegate to async equivalents; duplicating
10    // `# Errors` sections on every wrapper is busywork.
11    clippy::missing_errors_doc,
12    // Transitive dep graph (windows-sys, rand) routinely ships multiple
13    // versions; not actionable from this crate.
14    clippy::multiple_crate_versions,
15    // Casts we deliberately accept at the boundary (e.g. usize → i64 for
16    // serde-json numeric output bounded by realistic PDF sizes).
17    clippy::cast_possible_wrap,
18    clippy::cast_sign_loss,
19    clippy::cast_precision_loss,
20    // `Duration::from_mins` / `from_hours` are 1.94+; MSRV is 1.93.
21    clippy::duration_suboptimal_units,
22    // Too many false positives on plain English ("API", "JSON", etc.).
23    clippy::doc_markdown,
24)]
25#![cfg_attr(docsrs, feature(doc_cfg))]
26
27//! Poli Page SDK for Rust — render PDFs from HTML templates via the Poli Page API.
28//!
29//! See [`PoliPage`] for the entry-point client.
30
31pub mod client;
32pub mod documents;
33pub mod error;
34pub mod fs;
35pub mod render;
36pub mod retry;
37pub mod types;
38
39#[cfg(feature = "blocking")]
40#[cfg_attr(docsrs, doc(cfg(feature = "blocking")))]
41pub mod blocking;
42
43pub use client::{PoliPage, PoliPageBuilder};
44pub use documents::Documents;
45pub use error::{error_codes, Error, ErrorPayload};
46pub use fs::render_to_file;
47pub use render::Render;
48pub use retry::{RequestEvent, ResponseEvent, RetryEvent};
49pub use types::{
50    DocumentDescriptor, DocumentPreviewResult, MetadataValue, Orientation, PageFormat, RenderInput,
51    RenderMetadata, Thumbnail, ThumbnailFormat, ThumbnailOptions,
52};
53
54pub(crate) mod internal;