karmaio 0.1.0

A modern, fast, share-nothing asynchronous runtime for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::path::Path;

use crate::fs::DirBuilder;

/// Creates a new, empty directory at the provided path.
///
/// This is an async version of [`std::fs::create_dir`].
pub async fn create_dir(path: impl AsRef<Path>) -> std::io::Result<()> {
    DirBuilder::new().create(path).await
}

/// Recursively creates a directory and all of its parent components if they are missing.
///
/// This is an async version of [`std::fs::create_dir_all`].
pub async fn create_dir_all(path: impl AsRef<Path>) -> std::io::Result<()> {
    DirBuilder::new().recursive(true).create(path).await
}