1 unstable release

0.2.7 Aug 25, 2024

#685 in Configuration

Download history 86/week @ 2024-08-19 36/week @ 2024-08-26

122 downloads per month

GPL-2.0-only

15KB
310 lines

Pipelight files crate

Crate from pipelight an automation cli.

File error reports


lib.rs:

File - parse file types with pretty diagnostics.

Well structured parsing error reports with the language specific error types. thanks to the thiserror and miette crate.

Let say you want to deserialize to a Config struct.



let res = serde_yaml::from_str::<Value>(&string);
match res {
    Ok(res) => {
        // do things
    },
    Err(e) => {
        let err = YamlError::new(e, &string);
        return Err(err.into());
    }
};



let res = toml::from_str::<Value>(&string);
match res {
    Ok(res) => {
        // do things
    },
    Err(e) => {
        let err = TomlError::new(e, &string);
        return Err(err.into());
    }
};

Dependencies

~18–30MB
~496K SLoC