Skip to main content

Crate oai_pmh_rs

Crate oai_pmh_rs 

Source
Expand description

oai-pmh-rs is a robust, spec-compliant implementation of the OAI-PMH 2.0 (Open Archives Initiative Protocol for Metadata Harvesting) for Rust.

§Overview

This crate provides a reusable, transport-agnostic protocol engine that handles request validation, verb dispatch, error handling, and XML response generation according to the OAI-PMH specification.

It is designed to be embedded into repository services, allowing you to implement your own data layer while delegating all protocol behaviour to this crate.

§Architecture

The crate is split into two main layers:

  • core — transport-agnostic protocol logic, including:

    • verb handling (Identify, ListRecords, etc.)
    • request validation and error handling
    • resumption token handling
    • XML response generation
    • core::OaiProvider trait for repository integration
  • [transport::actix] (feature-gated) — HTTP integration for Actix Web applications, providing ready-to-use handlers.

§Usage

Typical usage:

  1. Implement core::OaiProvider for your repository or data source
  2. Convert incoming HTTP parameters into a key-value map
  3. Call core::handle_oai_request to produce an OAI-PMH XML response
  4. Return the response via your web framework (or use the Actix integration)

§Design Goals

  • Strict adherence to the OAI-PMH 2.0 specification
  • Clear separation between protocol logic and data access
  • Minimal assumptions about storage or transport layers
  • Composability across different services and applications

Modules§

core
Transport-agnostic OAI-PMH core engine.