pub fn write_pools<P>(&self, file: P) -> Result<(), std::io::Error>
    where
        P: AsRef<Path>,
    {
        let pools = serde_json::json!({
            "pools": self.pools.clone()
        });

        if let Ok(s) = serde_yaml::to_string(&pools) {
            let mut file = File::create(file)?;
            return file.write_all(s.as_bytes());
        }
        Err(std::io::Error::new(
            std::io::ErrorKind::Other,
            "failed to serialize the pool config",
        ))
    }
/// write the current pool configuration to disk
write the current pool configuration to disk
write the current pool configuration to disk
pub fn write_pools<P>(&self, file: P) -> Result<(), std::io::Error>
    where
        P: AsRef<Path>,
    {
        let pools = serde_json::json!({
            "pools": self.pools.clone()
        });
        if let Ok(s) = serde_yaml::to_string(&pools) {
            let mut file = File::create(file)?;
            return file.write_all(s.as_bytes());
        }
        Err(std::io::Error::new(
            std::io::ErrorKind::Other,
            "failed to serialize the pool config",
        ))
    }
pub fn write_pools < P > ( & self , file : P ) -> Result < ( ) , std :: io :: Error > where P : AsRef < Path > , { let pools = serde_json :: json ! ( { " " self pools clone ( ) } ) ; if let Ok ( s ) = serde_yaml :: to_string ( & pools ) { let mut file = File :: create ( file ) ? ; return file . write_all ( s . as_bytes ( ) ) ; } Err ( std :: io :: Error :: new ( std :: io :: ErrorKind :: Other , " " , ) ) }
write the current pool configuration to disk
write the current pool configuration to disk
&self
file
P