beez_process/
execution.rs1use std::ffi::OsString;
2use std::path::PathBuf;
3
4use beez_policy::HeadlessHarness;
5
6use crate::harness::HarnessCall;
7use crate::process_call::ProcessCall;
8
9#[derive(Clone, Debug, Eq, PartialEq)]
11pub enum ExecutionRequest {
12 Harness(HarnessCall),
14 Command(ProcessCall),
16}
17
18impl ExecutionRequest {
19 #[must_use]
21 pub fn harness(&self) -> Option<HeadlessHarness> {
22 match self {
23 Self::Harness(call) => Some(call.harness()),
24 Self::Command(_) => None,
25 }
26 }
27
28 pub(crate) fn into_parts(self) -> (PathBuf, Vec<OsString>) {
29 match self {
30 Self::Harness(call) => call.into_parts(),
31 Self::Command(call) => call.into_parts(),
32 }
33 }
34}