You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: async_fs.rs
    path of file: ./repos/taro/crates/taro_init/src
    
    the code of the file until where you have to start completion: use std::{path::Path, io::Result};

use futures::future::BoxFuture;

pub fn create_dir<P: AsRef<Path>>(dir: P) -> BoxFuture<'static, Result<()>> {
  let dir = dir.as_ref().to_string_lossy().to_string();
  let fut = async move { tokio::fs::create_dir(dir).await };
  Box::pin(fut)
}

pub fn create_dir_all<P: AsRef<std::path::Path>>(dir: P) -> BoxFuture<'static, Result<()>> {
  let dir = dir.as_ref().to_string_lossy().to_string();
  let fut = async move { tokio::fs::create_dir_all(dir).await };
  Box::pin(fut)
}

pub 
    
pub fn copy<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> BoxFuture<'static, Result<u64>> {
  let from = from.as_ref().to_path_buf();
  let to = to.as_ref().to_path_buf();
  let fut = async move {
    let bytes_copied = tokio::fs::copy(&from, &to).await?;
    // 以下部分仅适用于 UNIX 系统
    #[cfg(unix)]
    {
      // 获取源文件的元数据
      let src_metadata = metadata(&from).await?;
      // 获取源文件权限
      let src_permissions = src_metadata.permissions();
      // 设置目标文件的权限
      set_permissions(&to, src_permissions).await?;
    }
    Ok(bytes_copied)
  };
  Box::pin(fut)
}