pub fn write_pact(&self, output_path: &Option<String>) -> io::Result<()> {
        let pact_file_name = self.pact.default_file_name();
        let filename = match *output_path {
            Some(ref path) => {
                let mut path = PathBuf::from(path);
                path.push(pact_file_name);
                path
            },
            None => PathBuf::from(pact_file_name)
        };

        info!("Writing pact out to '{}'", filename.display());

        // Lock so that no two threads can read/write pact file at the same time.
        // TODO: Could use a fs-based lock in case multiple processes are doing
        // this concurrently?
        let _file_lock = PACT_FILE_MUTEX.lock().unwrap();

        match self.pact.write_pact(filename.as_path(), PactSpecification::V3) {
            Ok(_) => Ok(()),
            Err(err) => {
                warn!("Failed to write pact to file - {}", err);
                Err(err)
            }
        }
    }
/// Mock server writes its pact out to the provided directory
Mock server writes its pact out to the provided directory
Mock server writes its pact out to the provided directory
pub fn write_pact(&self, output_path: &Option<String>) -> io::Result<()> {
        let pact_file_name = self.pact.default_file_name();
        let filename = match *output_path {
            Some(ref path) => {
                let mut path = PathBuf::from(path);
                path.push(pact_file_name);
                path
            },
            None => PathBuf::from(pact_file_name)
        };
        info!("Writing pact out to '{}'", filename.display());
        // Lock so that no two threads can read/write pact file at the same time.
        // TODO: Could use a fs-based lock in case multiple processes are doing
        // this concurrently?
        let _file_lock = PACT_FILE_MUTEX.lock().unwrap();
        match self.pact.write_pact(filename.as_path(), PactSpecification::V3) {
            Ok(_) => Ok(()),
            Err(err) => {
                warn!("Failed to write pact to file - {}", err);
                Err(err)
            }
        }
    }
pub fn write_pact ( & self , output_path : & Option < String > ) -> io :: Result < ( ) > { let pact_file_name = self . pact . default_file_name ( ) ; let filename = match * output_path { Some ( ref path ) => { let mut path = PathBuf :: from ( path ) ; path . push ( pact_file_name ) ; path } , None => PathBuf :: from ( pact_file_name ) } ; info ! ( " " filename display ( ) ) ; // Lock so that no two threads can read/write pact file at the same time. // TODO: Could use a fs-based lock in case multiple processes are doing // this concurrently? let _file_lock = PACT_FILE_MUTEX . lock ( ) . unwrap ( ) ; match self . pact . write_pact ( filename . as_path ( ) , PactSpecification :: V3 ) { Ok ( _ ) => Ok ( ( ) ) , Err ( err ) => { warn ! ( " " err ) ; Err ( err ) } } }
Mock server writes its pact out to the provided directory
Mock server writes its pact out to the provided directory
&self
output_path
&Option<String>
&self
output_path
&Option<String>