1 unstable release

0.2.7 Aug 25, 2024

#906 in Configuration

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

~20–36MB
~537K SLoC