pub async fn create_with_id<S: Into<PathBuf>>(root: S, env_id: Uuid) -> Result<Self> {
        let root = root.into();
        // create required environment artifacts (the directory and an id file)
        create_dir_all(&root).await?;
        let mut id_file_name = PathBuf::from(&root);
        id_file_name.push(ID_FILE_NAME);
        write(id_file_name, env_id.as_bytes()).await?;
        info!(
            "Added a new environment '{}' at '{}' ",
            env_id,
            root.to_str().unwrap()
        );
        Ok(Environment {
            root: String::from(
                root.to_str()
                    .ok_or_else(|| AnyError::msg("Could not convert env root to string"))?,
            ),
            id: env_id,
        })
    }
///
/// Creates an environment with a specified UUID
///
Creates an environment with a specified UUID
Creates an environment with a specified UUID
pub async fn create_with_id<S: Into<PathBuf>>(root: S, env_id: Uuid) -> Result<Self> {
        let root = root.into();
        // create required environment artifacts (the directory and an id file)
        create_dir_all(&root).await?;
        let mut id_file_name = PathBuf::from(&root);
        id_file_name.push(ID_FILE_NAME);
        write(id_file_name, env_id.as_bytes()).await?;
        info!(
            "Added a new environment '{}' at '{}' ",
            env_id,
            root.to_str().unwrap()
        );
        Ok(Environment {
            root: String::from(
                root.to_str()
                    .ok_or_else(|| AnyError::msg("Could not convert env root to string"))?,
            ),
            id: env_id,
        })
    }
pub async fn create_with_id < S : Into < PathBuf > > ( root : S , env_id : Uuid ) -> Result < Self > { let root = root . into ( ) ; // create required environment artifacts (the directory and an id file) create_dir_all ( & root ) . await ? ; let mut id_file_name = PathBuf :: from ( & root ) ; id_file_name . push ( ID_FILE_NAME ) ; write ( id_file_name , env_id . as_bytes ( ) ) . await ? ; info ! ( " " env_id root to_str ( ) unwrap ( ) ) ; Ok ( Environment { root : String :: from ( root . to_str ( ) . ok_or_else ( | | AnyError :: msg ( " " ) ) ? , ) , id : env_id , } ) }
Creates an environment with a specified UUID
Creates an environment with a specified UUID
root
S
env_id
Uuid
root
S
env_id
Uuid