cplex_rs/parameters/read/
mod.rs1use ffi::{CPXPARAM_Read_APIEncoding, CPXPARAM_Read_DataCheck};
2
3use crate::parameters::{private, Parameter, ParameterValue};
4
5impl private::Parameter for APIEncoding {}
6impl private::Parameter for DataCheck {}
7
8#[derive(Copy, Clone, Debug)]
11pub struct APIEncoding(pub &'static str);
12
13impl Parameter for APIEncoding {
14    fn value(&self) -> ParameterValue {
15        ParameterValue::String(self.0)
16    }
17
18    fn id(&self) -> u32 {
19        CPXPARAM_Read_APIEncoding
20    }
21}
22
23#[derive(Copy, Clone, Debug)]
26pub enum DataCheck {
27    Off,
28    Warning,
29    Assist,
30}
31
32impl Parameter for DataCheck {
33    fn value(&self) -> ParameterValue {
34        ParameterValue::Integer(match self {
35            Self::Off => 0,
36            Self::Warning => 1,
37            Self::Assist => 2,
38        })
39    }
40
41    fn id(&self) -> u32 {
42        CPXPARAM_Read_DataCheck
43    }
44}