Skip to main content

Executor

Trait Executor 

Source
pub trait Executor: CloneBoxExecutor {
    // Required methods
    fn exec(&self, spec: &Spec) -> Result<(), ExecutorError>;
    fn validate(&self, spec: &Spec) -> Result<(), ExecutorValidationError>;

    // Provided method
    fn setup_envs(
        &self,
        envs: HashMap<String, String>,
    ) -> Result<(), ExecutorSetEnvsError> { ... }
}

Required Methods§

Source

fn exec(&self, spec: &Spec) -> Result<(), ExecutorError>

Executes the workload

Source

fn validate(&self, spec: &Spec) -> Result<(), ExecutorValidationError>

Validate if the spec can be executed by the executor. This step runs after the container init process is created, entered into the correct namespace and cgroups, and pivot_root into the rootfs. But this step runs before waiting for the container start signal.

Provided Methods§

Source

fn setup_envs( &self, envs: HashMap<String, String>, ) -> Result<(), ExecutorSetEnvsError>

Set environment variables for the container process to be executed. This step runs after the container init process is created, entered into the correct namespace and cgroups, and pivot_root into the rootfs. But this step runs before waiting for the container start signal. The host’s environment variables are not cleared yet at this point. They should be cleared explicitly if needed.

Trait Implementations§

Source§

impl Clone for Box<dyn Executor>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§