xberg 1.3.4

High-performance document intelligence library for Rust. Extract text, metadata, and structured data from PDFs, Office documents, images, and 107 formats and 371 programming languages via tree-sitter code intelligence with async/sync APIs.
Documentation
//! Rust-only engine extension seams.
//!
//! Cache and progress are injectable through [`EngineBuilder`](super::EngineBuilder).
//! The remaining traits expose standalone Rust primitives for structured extraction,
//! preset lookup, LLM calls, and model resolution; they are not Engine configuration.
//!
//! These are deliberately **not** part of the language-binding surface: the
//! whole `engine` module is a bare `pub mod engine;` in `lib.rs` whose files are
//! not listed in `alef.toml` `sources`, so the binding generator emits nothing
//! for them. The trait names and public seam types are also listed in
//! `alef.toml` `[crates.exclude] types` as belt-and-suspenders.
//!

mod cache;
mod progress;

#[cfg(feature = "liter-llm")]
mod llm_client;
#[cfg(feature = "presets")]
mod preset_resolver;
#[cfg(feature = "heuristics")]
mod structured_policy;

#[cfg(feature = "layout-detection")]
mod model_provider;

pub use cache::{CacheBackend, NoopCache};
// ~keep Liveness is configuration-dependent: the only consumers are compiled out on
// narrow feature legs, so `-D dead-code` fires there and nowhere else. A hand-kept
// union-of-consumers `cfg` is what drifted here and failed the 1.3.0 publish (GH#1951).
#[cfg(any(test, feature = "ocr", feature = "ocr-pipeline"))]
#[allow(unused_imports)]
pub(crate) use progress::emit_ocr_page;
#[cfg(all(feature = "tokio-runtime", any(feature = "ocr", feature = "ocr-pipeline")))]
#[allow(unused_imports)]
pub(crate) use progress::inherit_progress;
#[cfg(feature = "tokio-runtime")]
pub(crate) use progress::scope_progress;
pub use progress::{NoopProgressSink, ProgressEvent, ProgressSink};

#[cfg(feature = "liter-llm")]
pub use llm_client::{LiterLlmClient, LlmClient};
#[cfg(feature = "presets")]
pub use preset_resolver::{CorePresetResolver, PresetResolver};
#[cfg(feature = "heuristics")]
pub use structured_policy::{DefaultStructuredPolicy, StructuredPolicy};

#[cfg(feature = "layout-detection")]
pub use model_provider::{DefaultModelProvider, ModelId, ModelProvider};