this-env 0.1.32

This.Env Data Formatter
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use this_env::env::{Env, EnvType, TrustLevel};

#[test]
fn test_env_operations() {
    let base_path = std::path::Path::new(".this/env");
    let mut env = Env::new(
        "example.com".to_string(),
        "env123".to_string(),
        EnvType::RemoteWeb,
        TrustLevel::High,
    );

    env.set_metadata("location", "datacenter");
    env.add_endorsement("alice", "sig123");
    assert!(env.save(base_path).is_ok());
    assert_eq!(env.get_metadata("location"), Some(&"datacenter".to_string()));
    assert!(env.is_endorsed_by("alice"));
}