Skip to main content

dotenv_filtered

Function dotenv_filtered 

Source
pub unsafe fn dotenv_filtered(filter_keys: &[&str]) -> Result<(), Error>
Expand description

A version of dotenvy::dotenv which only loads whitelisted keys.

ยงSafety

This fn calls std::env::set_var under-the-hood, which is not threadsafe on some platforms (ex: glibc Linux). The caller must ensure that this fn is called very early in the program lifetime, before any threads are spawned.