pub enum Isolation {
None {},
Worktree {},
Container {
image: Option<String>,
network: bool,
},
}Expand description
How much of the machine a node is kept away from.
The ladder is real but not linear in cost: Worktree is nearly free and is
what makes parallel writers safe, while Container buys filesystem and
network separation at the price of a Docker daemon and an image pull.
Container degrades rather than fails. If Docker is not present the node
runs under Worktree and the run records a warning — a config written on a
machine with Docker must still work on one without, because the same loop
directory gets checked out on developer laptops, CI runners and servers, and
refusing to start there would make container isolation unusable in practice
rather than merely unavailable.
Variants§
None
Runs directly in the loop directory. Correct for a single writer or a read-only node.
Worktree
Runs in its own git worktree, published back on success. Required for parallel writers.
Container
Runs in a container over its own worktree.
Implementations§
Source§impl Isolation
impl Isolation
Sourcepub fn needs_worktree(&self) -> bool
pub fn needs_worktree(&self) -> bool
Whether this node needs a worktree of its own. Container isolation implies one, because the container mounts it.
Sourcepub fn is_container(&self) -> bool
pub fn is_container(&self) -> bool
What this becomes when Docker is unavailable.
Sourcepub fn container_image<'a>(
&'a self,
graph_default: Option<&'a str>,
) -> Option<&'a str>
pub fn container_image<'a>( &'a self, graph_default: Option<&'a str>, ) -> Option<&'a str>
The image a container node runs in: its own, or the graph’s default.
None for a non-container node, or when neither names one.
pub fn without_container(&self) -> Isolation
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Isolation
impl<'de> Deserialize<'de> for Isolation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Isolation
Source§impl JsonSchema for Isolation
impl JsonSchema for Isolation
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreimpl StructuralPartialEq for Isolation
Auto Trait Implementations§
impl Freeze for Isolation
impl RefUnwindSafe for Isolation
impl Send for Isolation
impl Sync for Isolation
impl Unpin for Isolation
impl UnsafeUnpin for Isolation
impl UnwindSafe for Isolation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.