Skip to main content

var

Function var 

Source
pub fn var(name: &str) -> Result<String, SealedEnvError>
Expand description

Read an encrypted variable from the process environment.

This is the strict variant: the variable must be present and encrypted. Use var_or_plain if you want plaintext values to pass through.

ยงExamples

use sealed_env::var;

std::env::set_var("SEALED_KEY", "<base64-key>");
std::env::set_var("DATABASE_PASSWORD", "ENCv1:...:...");

let value = var("DATABASE_PASSWORD")?;