batch_mode_batch_triple/
batch_file_state.rs1crate::ix!();
3
4#[derive(Debug, PartialEq, Eq)]
6pub enum BatchFileState {
7 InputOnly, InputOutput, InputError, InputOutputError, }
12
13impl From<&BatchFileTriple> for BatchFileState {
14
15 fn from(triple: &BatchFileTriple) -> BatchFileState {
17
18 let has_input = triple.input().is_some();
19 let has_error = triple.error().is_some();
20 let has_output = triple.output().is_some();
21
22 match (has_input, has_output, has_error) {
23 (true, true, true) => BatchFileState::InputOutputError,
24 (true, true, false) => BatchFileState::InputOutput,
25 (true, false, true) => BatchFileState::InputError,
26 (true, false, false) => BatchFileState::InputOnly,
27 _ => unreachable!("Input file must be present at this point"),
28 }
29 }
30}