1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! Reading the configuration a Lambda receives as environment variables.
//!
//! Configuration is read once, in `main`, before the first invocation; a
//! variable the function cannot run without fails the cold start instead of
//! the first request that needs it. Errors name the variable and never echo
//! its value, because values are often ARNs, URLs or credentials.
use crateRuntimeError;
/// A variable the function cannot run without.
///
/// # Errors
///
/// Returns [`RuntimeError::Configuration`] naming the variable when it is
/// absent or not valid Unicode.
/// A variable that may be absent: `None` when it is unset, empty or blank.
/// A comma-separated list, each entry trimmed, empty entries dropped.
///
/// Trimming matters: `HTTP_ALLOWED_ORIGINS="https://a, https://b"` must allow
/// `https://b`, not `" https://b"`.
///
/// # Errors
///
/// Returns [`RuntimeError::Configuration`] when the variable is absent.