Skip to main content

oai_pmh_rs/
lib.rs

1//! `oai-pmh-rs` is a robust, spec-compliant implementation of the
2//! [OAI-PMH 2.0](https://www.openarchives.org/OAI/openarchivesprotocol.html)
3//! (Open Archives Initiative Protocol for Metadata Harvesting) for Rust.
4//!
5//! ## Overview
6//!
7//! This crate provides a reusable, transport-agnostic protocol engine that
8//! handles request validation, verb dispatch, error handling, and XML response
9//! generation according to the OAI-PMH specification.
10//!
11//! It is designed to be embedded into repository services, allowing you to
12//! implement your own data layer while delegating all protocol behaviour to
13//! this crate.
14//!
15//! ## Architecture
16//!
17//! The crate is split into two main layers:
18//!
19//! - [`core`] — transport-agnostic protocol logic, including:
20//!   - verb handling (`Identify`, `ListRecords`, etc.)
21//!   - request validation and error handling
22//!   - resumption token handling
23//!   - XML response generation
24//!   - [`core::OaiProvider`] trait for repository integration
25//!
26//! - [`transport::actix`] *(feature-gated)* — HTTP integration for Actix Web
27//!   applications, providing ready-to-use handlers.
28//!
29//! ## Usage
30//!
31//! Typical usage:
32//!
33//! 1. Implement [`core::OaiProvider`] for your repository or data source
34//! 2. Convert incoming HTTP parameters into a key-value map
35//! 3. Call [`core::handle_oai_request`] to produce an OAI-PMH XML response
36//! 4. Return the response via your web framework (or use the Actix integration)
37//!
38//! ## Design Goals
39//!
40//! - Strict adherence to the OAI-PMH 2.0 specification
41//! - Clear separation between protocol logic and data access
42//! - Minimal assumptions about storage or transport layers
43//! - Composability across different services and applications
44//!
45
46pub mod core;
47
48#[cfg(feature = "actix")]
49pub mod transport;