18 releases (breaking)

Uses new Rust 2024

new 0.65.0 Jun 8, 2026
0.63.0 Jun 4, 2026

#2 in #error

Download history 65/week @ 2026-05-19 136/week @ 2026-05-26 79/week @ 2026-06-02

280 downloads per month
Used in 9 crates (4 directly)

MIT/Apache

14KB
137 lines

citum-resolver-api

Lightweight interface crate that defines how the Citum schema layer talks to the storage and resolution layer (filesystem, HTTP, git, etc.). Keeps the schema crate dependency-free of network/IO concerns while letting consumers swap resolver implementations.

This crate is mostly traits and error types. End users typically use citum_store or higher-level engine APIs; resolver implementors should depend on this crate directly.

Usage

Implementors define a StyleResolver and choose their own concrete Style and Locale types (typically citum-schema-style's Style and Locale):

use citum_resolver_api::{ResolverError, StyleResolver};

struct MyResolver;

impl StyleResolver for MyResolver {
    type Style = Vec<u8>;
    type Locale = Vec<u8>;

    fn resolve_style(&self, uri: &str) -> Result<Self::Style, ResolverError> {
        // load and parse the style identified by `uri`
        todo!()
    }

    fn resolve_locale(&self, id: &str) -> Result<Self::Locale, ResolverError> {
        // load and parse the locale by BCP 47 id
        todo!()
    }
}

Project

Part of Citum, a modern citation engine in Rust. See the workspace README for the full architecture.

License

Dual-licensed under MIT or Apache-2.0 at your option.

Dependencies

~0.4–1.1MB
~23K SLoC