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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//! The `NETSUKE_WHICH_WORKSPACE` opt-out switch for the workspace fallback.
//!
//! A leaf module by design: `env::EnvSnapshot::capture` reads the variable at
//! the resolver's ambient boundary, translates the reading into
//! [`WorkspaceSwitch`], and stores that as snapshot data; `lookup::workspace`
//! asks the stored state whether to search. Placing the name and the domain
//! state here keeps both consumers pointing downward — the earlier
//! arrangement had `env` calling back into `lookup::workspace`, a module
//! cycle.
//!
//! The state is deliberately infrastructure-free: it names no
//! `std::env::VarError` and emits no diagnostics. Translating the platform
//! reading and warning about a mis-encoded value both belong to the adapter
//! that performs the read, so `env` owns the `From` conversion and the
//! non-UTF-8 warning.
/// The variable a user sets to switch the workspace fallback off.
pub const WORKSPACE_FALLBACK_ENV: &str = "NETSUKE_WHICH_WORKSPACE";
/// The workspace switch as captured, in domain terms.
///
/// Three states rather than a bare `bool` because the cache fingerprint must
/// distinguish them — two resolutions differing only in this switch must not
/// share a cache entry — and because the adapter reports the non-UTF-8 case
/// to the user. `Hash` is derived, so the fingerprint hashes the state
/// directly instead of flattening a non-`Hash` platform error.
pub