use std::fs; use std::io; use std::path::Path; use futures::{Future, Poll}; /// Removes an existing, empty directory. /// /// This is an async version of [`std::fs::remove_dir`][std] /// /// [std]: https://doc.rust-lang.org/std/fs/fn.remove_dir.html pub fn remove_dir>(path: P) -> RemoveDirFuture

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

where P: AsRef { path: P, } impl

RemoveDirFuture

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

{ RemoveDirFuture { path: path, } } } impl

Future for RemoveDirFuture

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