pub fn from_text_file<K: AsRef<std::path::Path>>(file: K) -> Self {
        use std::fs::read;
        let tmp = file.as_ref().to_path_buf();
        Self::dynamic(move || {
            Ok(T::from(
                String::from_utf8(read(&tmp)?)?.as_str().trim().to_string(),
            ))
        })
    }
Variable which dynamically resolves to the value of an UTF-8 encoded text file
(removing all leading and trailing whitespaces.
rusoto/credential/src/variable.rs