Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

🦀 Rust crate

crates.io docs.rs Size Downloads

The ACORN CLI application is built on top of the acorn-lib Rust crate. The acorn-lib library provides core functionalities for working with ACORN schemas, validating persistent identifiers1, and generating artifacts.

Installation

  • Add acorn-lib as a dependency in your Cargo.toml2

    [dependencies]
    acorn-lib = "0.1.45"
    
  • Use acorn-lib functions in your Rust code

    #![allow(unused)]
    fn main() {
    use acorn::schema::validate::{is_ark, is_doi, is_orcid, is_ror};
    
    assert!(is_ark("ark:/1234/w5678"));
    assert!(is_doi("10.11578/dc.20250604.1"));
    assert!(is_orcid("https://orcid.org/0000-0002-2057-9115"));
    assert!(is_ror("01qz5mb56"));
    }
  • If you want to use the full capability of acorn-lib to build your own CLI app, be sure to include the following in your Cargo.toml to enable the doctor and powerpoint features3

    [dependencies]
    acorn-lib = { version = "0.1.45", features = ["doctor", "powerpoint"] }
    

  1. Persistent Identifiers (PIDs) supported by acorn-lib include DOIs, ORCIDs, RAiDs, RORs, and ARKs.

  2. Check crates.io for the latest version

  3. See the Cargo.toml for more details.