pub fn make_config( 
        with_header : bool,
        unit_str    : String,
        true_str    : String,
        false_str   : String
    ) -> Result<Self>
    {
        if true_str == false_str || unit_str.is_empty() || true_str.is_empty() || false_str.is_empty() {
            return Err( Error::new( ErrorCode::InvalidConfig, 0, 0 ));
        } else {
            for i in 0..3 {
                if unit_str.find(  RESERVED_CHAR[i] ).is_some()
                || true_str.find(  RESERVED_CHAR[i] ).is_some()
                || false_str.find( RESERVED_CHAR[i] ).is_some()
                {
                    return Err( Error::new( ErrorCode::InvalidConfig, 0, 0 ));
                }
            }
        }
        Ok( Config{ with_header, unit_str, true_str, false_str })
    }
/// Tries to creates a new `Config` structure. Result is Ok if the config does not violate the spec, otherwise Err.
Tries to creates a new `Config` structure. Result is Ok if the config does not violate the spec, otherwise Err.
Tries to creates a new ` Config ` structure . Result is Ok if the config does not violate the spec otherwise Err .
pub fn make_config( 
        with_header : bool,
        unit_str    : String,
        true_str    : String,
        false_str   : String
    ) -> Result<Self>
    {
        if true_str == false_str || unit_str.is_empty() || true_str.is_empty() || false_str.is_empty() {
            return Err( Error::new( ErrorCode::InvalidConfig, 0, 0 ));
        } else {
            for i in 0..3 {
                if unit_str.find(  RESERVED_CHAR[i] ).is_some()
                || true_str.find(  RESERVED_CHAR[i] ).is_some()
                || false_str.find( RESERVED_CHAR[i] ).is_some()
                {
                    return Err( Error::new( ErrorCode::InvalidConfig, 0, 0 ));
                }
            }
        }
        Ok( Config{ with_header, unit_str, true_str, false_str })
    }
pub fn make_config ( with_header : bool , unit_str : String , true_str : String , false_str : String ) -> Result < Self > { if true_str == false_str || unit_str . is_empty ( ) || true_str . is_empty ( ) || false_str . is_empty ( ) { return Err ( Error :: new ( ErrorCode :: InvalidConfig , 0 , 0 ) ) ; } else { for i in 0 .. 3 { if unit_str . find ( RESERVED_CHAR [ i ] ) . is_some ( ) || true_str . find ( RESERVED_CHAR [ i ] ) . is_some ( ) || false_str . find ( RESERVED_CHAR [ i ] ) . is_some ( ) { return Err ( Error :: new ( ErrorCode :: InvalidConfig , 0 , 0 ) ) ; } } } Ok ( Config { with_header , unit_str , true_str , false_str } ) }
Tries to creates a new `Config` structure.
Tries to creates a new ` Config ` structure .
with_header
bool
unit_str
String
true_str
String
false_str
String