mabel-eno

Crates.iomabel-eno
lib.rsmabel-eno
version0.4.4
sourcesrc
created_at2024-05-22 18:12:11.001652
updated_at2024-05-25 03:30:45.293166
descriptionEno parsing library for Rust
homepage
repositoryhttps://codeberg.org/fawn/mabel
max_upload_size
id1248264
size165,567
fawn (fawni)

documentation

README

enolib

A feature-complete, pure rust parser for Eno.

Note on packaging: Not yet released as a crate, but can be pulled in via git regardless.

Note on stability: The parsing itself is quite stable, the API is currently still in flux though.

Getting started

Add the library to the dependencies in your Cargo.toml:

[dependencies]
...
enolib = { git = "https://codeberg.org/simonrepp/enolib-rs" }

Some example code to get you started:

use enolib;

fn main() {
    let result = my_parse("greeting: hello");
    
    dbg!(result); // Ok("hello")
}

fn my_parse(input: &str) -> Result<String, enolib::Error> {
    enolib::parse(input)?
      .field("greeting")?
      .required_value()
}

Until there is more documentation, I recommend you clone the repository and in its root run this to generate and access the documentation in your browser:

cargo doc --no-deps --open

From there go to the documentation for parse and traverse the documentation for what it returns downwards, until you are at the bottom of the tree, where you have everything you need to parse any eno document!

Commit count: 0

cargo fmt