pub enum Confinement {
LinuxNamespaces {
wrapper: PathBuf,
},
WindowsJobObject,
CopiedTree,
Unavailable {
missing: Missing,
},
}Expand description
The backends, by platform, each carrying what it promises.
WindowsJobObject is the arm a Windows machine with a job-object
enforcer compiled in would report. No build of this crate constructs
one, because CreateJobObject is a foreign call the workspace
forbids outside crates/desktop/; a Windows machine therefore reports
Confinement::CopiedTree, whose Assurances say what it does
not hold (the network, above all) rather than implying it holds
everything a job object would.
Variants§
LinuxNamespaces
Namespaces of its own — mount, network, process, user — made by a wrapper program on this machine.
WindowsJobObject
A Windows job object: the tree ends together, the limits hold, and the network is not isolated.
CopiedTree
The floor every platform has: the command runs in a copy of the working tree, and the tree itself is not what it writes to.
No arm at all, and what this machine is missing.
Implementations§
Source§impl Confinement
impl Confinement
Sourcepub fn detect() -> Confinement
pub fn detect() -> Confinement
The arm this machine gives a command. One sampling point: the scratch root, the search path and this platform are asked here and nowhere else, so a report and a placement cannot disagree.
Sourcepub fn choose(offered: &Offerings) -> Confinement
pub fn choose(offered: &Offerings) -> Confinement
The arm a machine with these capabilities gives.
Sourcepub fn assurances(&self) -> Assurances
pub fn assurances(&self) -> Assurances
What this arm promises. A pure function of the arm, so a report can be read without running anything.
Sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
The name a report carries. Closed and spelled once, because a page, a refusal and a test all have to mean the same arm.
Sourcepub fn statement(&self) -> String
pub fn statement(&self) -> String
What a command under this arm can and cannot count on, in one
sentence. Derived from Confinement::assurances rather than
written beside it, so the sentence cannot drift from the type.