use std::fs; use std::io; use std::path::Path; use futures::{Future, Poll}; /// Creates a new, empty directory at the provided path /// /// This is an async version of [`std::fs::create_dir`][std] /// /// [std]: https://doc.rust-lang.org/std/fs/fn.create_dir.html pub fn create_dir>(path: P) -> CreateDirFuture

{ CreateDirFuture::new(path) } /// Future returned by `create_dir`. #[derive(Debug)] pub struct CreateDirFuture

where P: AsRef { path: P, } impl

CreateDirFuture

where P: AsRef { fn new(path: P) -> CreateDirFuture

{ CreateDirFuture { path: path, } } } impl

Future for CreateDirFuture

where P: AsRef { type Item = (); type Error = io::Error; fn poll(&mut self) -> Poll { ::blocking_io(|| fs::create_dir(&self.path) ) } }