tokio/fs/
symlink_dir.rs

1use crate::fs::asyncify;
2
3use std::io;
4use std::path::Path;
5
6/// Creates a new directory symlink on the filesystem.
7///
8/// The `dst` path will be a directory symbolic link pointing to the `src`
9/// path.
10///
11/// This is an async version of [`std::os::windows::fs::symlink_dir`][std]
12///
13/// [std]: https://doc.rust-lang.org/std/os/windows/fs/fn.symlink_dir.html
14pub async fn symlink_dir(src: impl AsRef<Path>, dst: impl AsRef<Path>) -> io::Result<()> {
15    let src = src.as_ref().to_owned();
16    let dst = dst.as_ref().to_owned();
17
18    asyncify(move || std::os::windows::fs::symlink_dir(src, dst)).await
19}