pub struct LaunchPlan {
pub mounts: Vec<Mount>,
pub env_literal: Vec<(String, String)>,
pub env_passthrough: Vec<String>,
pub args: Vec<String>,
pub cap_add: Vec<String>,
}Expand description
All caller-controlled variable parts of a container run invocation.
Session::start builds the fixed base flags and the workspace mount
internally, then appends everything in this struct.
Assemble with LaunchPlan::default() and fill fields as needed, or
collect them via run_package.
Fields§
§mounts: Vec<Mount>Extra bind-mounts beyond the session workspace.
Each entry becomes a -v host:container:mode argument. Paths must
already be canonical absolute host paths.
env_literal: Vec<(String, String)>Literal environment variables injected into the container.
Each (K, V) pair becomes a -e K=V argument.
env_passthrough: Vec<String>Environment variable names forwarded from npxc’s own process
environment. Each name becomes a bare -e K argument; the container
runtime inherits the value from npxc’s environment at launch time.
Secrets never touch the npxc config file when this mechanism is used.
args: Vec<String>Arguments appended after the image tag.
These are forwarded verbatim to the container’s entrypoint.
cap_add: Vec<String>Linux capabilities to add back on top of --cap-drop ALL.
Each entry becomes a --cap-add <CAP> argument. Used by tunnel mode to
grant NET_ADMIN so the entrypoint can configure wg0.
Implementations§
Source§impl LaunchPlan
impl LaunchPlan
Sourcepub fn build(
pkg_name: &str,
effective: &EffectiveConfig,
cwd: &Path,
args: Vec<String>,
no_isolate: bool,
) -> Result<Self, NpxcError>
pub fn build( pkg_name: &str, effective: &EffectiveConfig, cwd: &Path, args: Vec<String>, no_isolate: bool, ) -> Result<Self, NpxcError>
Assemble a LaunchPlan from the resolved package configuration.
Steps, in order:
- Populate
env_literalandenv_passthroughfromeffective. - Store
argsverbatim. - Validate and add each config-declared directory mount.
Relative
hostpaths are resolved againstcwd; every path is checked to lie within the CWD scope viavalidate_path. - When
effective.storage.persistis set, create the per-package host directory under the platform data dir and add a read-write mount at/data. --no-isolate— whenno_isolateistrue, append a read-only bind-mount of the canonicalized CWD at its own absolute path so host paths resolve identically inside the guest.
§Errors
Returns NpxcError::PathOutOfScope or NpxcError::PathNotFound
if a config-declared mount path fails CWD validation, or
NpxcError::Io if the persistent storage directory cannot be created.
Trait Implementations§
Source§impl Debug for LaunchPlan
impl Debug for LaunchPlan
Source§impl Default for LaunchPlan
impl Default for LaunchPlan
Source§fn default() -> LaunchPlan
fn default() -> LaunchPlan
Auto Trait Implementations§
impl Freeze for LaunchPlan
impl RefUnwindSafe for LaunchPlan
impl Send for LaunchPlan
impl Sync for LaunchPlan
impl Unpin for LaunchPlan
impl UnsafeUnpin for LaunchPlan
impl UnwindSafe for LaunchPlan
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more