pub fn write_to_file<P: AsRef<Path>>(&self, file_path: P) -> Result<(), MeshSimError> {
        let data = toml::to_string(self).map_err(|e| {
            let err_msg = String::from("Failed to serialize configuration data");
            MeshSimError {
                kind: MeshSimErrorKind::Serialization(err_msg),
                cause: Some(Box::new(e)),
            }
        })?;
        File::create(&file_path)
            .and_then(|mut file| write!(file, "{}", data))
            .map_err(|e| {
                let err_msg = String::from("Error writing configuration to file");
                MeshSimError {
                    kind: MeshSimErrorKind::Configuration(err_msg),
                    cause: Some(Box::new(e)),
                }
            })?;

        Ok(())
    }
///Writes the current configuration object to a formatted configuration file, that can be passed to
///the worker_cli binary.
Writes the current configuration object to a formatted configuration file, that can be passed to
the worker_cli binary.
Writes the current configuration object to a formatted configuration file that can be passed to the worker_cli binary .
pub fn write_to_file<P: AsRef<Path>>(&self, file_path: P) -> Result<(), MeshSimError> {
        let data = toml::to_string(self).map_err(|e| {
            let err_msg = String::from("Failed to serialize configuration data");
            MeshSimError {
                kind: MeshSimErrorKind::Serialization(err_msg),
                cause: Some(Box::new(e)),
            }
        })?;
        File::create(&file_path)
            .and_then(|mut file| write!(file, "{}", data))
            .map_err(|e| {
                let err_msg = String::from("Error writing configuration to file");
                MeshSimError {
                    kind: MeshSimErrorKind::Configuration(err_msg),
                    cause: Some(Box::new(e)),
                }
            })?;
        Ok(())
    }
pub fn write_to_file < P : AsRef < Path > > ( & self , file_path : P ) -> Result < ( ) , MeshSimError > { let data = toml :: to_string ( self ) . map_err ( | e | { let err_msg = String :: from ( " " ) ; MeshSimError { kind : MeshSimErrorKind :: Serialization ( err_msg ) , cause : Some ( Box :: new ( e ) ) , } } ) ? ; File :: create ( & file_path ) . and_then ( | mut file | write ! ( file " " data ) ) . map_err ( | e | { let err_msg = String :: from ( " " ) ; MeshSimError { kind : MeshSimErrorKind :: Configuration ( err_msg ) , cause : Some ( Box :: new ( e ) ) , } } ) ? ; Ok ( ( ) ) }
Writes the current configuration object to a formatted configuration file, that can be passed to
the worker_cli binary.
Writes the current configuration object to a formatted configuration file that can be passed to the worker_cli binary .
&self
file_path
P