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§
Sourcefn validate(&self, spec: &Spec) -> Result<(), ExecutorValidationError>
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§
Sourcefn setup_envs(
&self,
envs: HashMap<String, String>,
) -> Result<(), ExecutorSetEnvsError>
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§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".