pub fn as_str_from_env(&self) -> Result<(Option<String>, String), DatamodelError> {
        match &self.value {
            ast::Expression::Function(name, _, _) if name == "env" => {
                let env_function = self.as_env_function()?;
                let var_name = Some(env_function.var_name().to_string());
                let value = env_function.evaluate().and_then(|x| x.as_str())?;
                Ok((var_name, value))
            }
            ast::Expression::StringValue(value, _) => Ok((None, value.to_string())),
            _ => Err(self.construct_type_mismatch_error("String")),
        }
    }
/// returns a (Some(a), b) if the string was deducted from an env var
returns a (Some(a), b) if the string was deducted from an env var
returns a ( Some ( a ) b ) if the string was deducted from an env var
pub fn as_str_from_env(&self) -> Result<(Option<String>, String), DatamodelError> {
        match &self.value {
            ast::Expression::Function(name, _, _) if name == "env" => {
                let env_function = self.as_env_function()?;
                let var_name = Some(env_function.var_name().to_string());
                let value = env_function.evaluate().and_then(|x| x.as_str())?;
                Ok((var_name, value))
            }
            ast::Expression::StringValue(value, _) => Ok((None, value.to_string())),
            _ => Err(self.construct_type_mismatch_error("String")),
        }
    }
pub fn as_str_from_env ( & self ) -> Result < ( Option < String > , String ) , DatamodelError > { match & self . value { ast :: Expression :: Function ( name , _ , _ ) if name == " " => { let env_function = self . as_env_function ( ) ? ; let var_name = Some ( env_function . var_name ( ) . to_string ( ) ) ; let value = env_function . evaluate ( ) . and_then ( | x | x . as_str ( ) ) ? ; Ok ( ( var_name , value ) ) } ast :: Expression :: StringValue ( value , _ ) => Ok ( ( None , value . to_string ( ) ) ) , _ => Err ( self . construct_type_mismatch_error ( " " ) ) , } }
returns a (Some(a), b) if the string was deducted from an env var
returns a ( Some ( a ) b ) if the string was deducted from an env var
&self
&self