envl

Crates.ioenvl
lib.rsenvl
version0.11.3
created_at2025-08-16 11:24:31.269033+00
updated_at2026-01-02 21:47:29.954999+00
descriptionload .envl and .envlconf
homepage
repositoryhttps://github.com/ROBOTofficial/envl
max_upload_size
id1798328
size43,097
ROBOT (ro80t)

documentation

README

Envl for Rust

This is an envl lib for Rust.

Install

cargo add envl

Usage

For more details, please see here.

Install

cargo add envl
cargo add envl --build

.envlconf

settings {}

vars {
    a: string,
    b: int,
    c: bool,
    d: Array<int>,
    e: struct {
        v: struct {
            a: string;
        };
        w: Array<struct {
            a: string;
        }>;
        x: int;
        y: bool;
        z: Array<string>;
    },
    f: Array<Array<bool>>
}

.envl

a = "123";
b = 123;
c = true;
d = [123, 456];
e = struct {
    v: struct {
        a: "hello world"
    },
    w: [
        struct {
            a: "hi!"
        }
    ],
    x: 111,
    y: false,
    z: ["hello", "world"],
};
f = [
    [true],
    [false]
];

Cargo.toml

[package]
...
build = "build.rs"

build.rs

use envl::load_envl;

fn main() {
    if let Err(err) = load_envl("src/envl.rs".to_string()) {
        panic!("{:?}", err);
    };
}

src/main.rs

pub mod envl;

pub fn main() {
    let env = envl::envl();

    println!("{}", env.a);
    println!("{}", env.b);
    println!("{}", env.c);
    println!("{:?}", env.d);
}
Commit count: 235

cargo fmt