batch_mode_batch_client/
batch_online_status.rs

1// ---------------- [ File: batch-mode-batch-client/src/batch_online_status.rs ]
2crate::ix!();
3
4#[derive(Debug,Copy,Clone,PartialEq,Eq)]
5pub struct BatchOnlineStatus {
6    output_file_available: bool,
7    error_file_available:  bool,
8}
9
10impl From<&Batch> for BatchOnlineStatus {
11
12    fn from(batch: &Batch) -> Self {
13        Self {
14            output_file_available: batch.output_file_id.is_some(),
15            error_file_available:  batch.error_file_id.is_some(),
16        }
17    }
18}
19
20impl BatchOnlineStatus {
21
22    pub fn output_file_available(&self) -> bool { 
23        self.output_file_available 
24    }
25
26    pub fn error_file_available(&self) -> bool { 
27        self.error_file_available 
28    }
29}