future-parking_lot

This is an "as simple as possible" Future implementation for parkinglot. It works on AsRef<Mutex<T>> and AsRef<RwLock<T>> instead of directly on Mutex<T> and RwLock<T> for borrowing reasons (the lock must not live inside the Future, it would be dropped with it). This comes handy when you have global vars (like when using lazystatic) and you need to edit them from a Future environment.

Example: ``` use std::sync::Arc;

use tokio::run;

use parking_lot::RwLock;

use futureparkinglot::rwlock::{FutureReadable, FutureWriteable};

use lazystatic::lazystatic;

lazy_static! { static ref LOCK: Arc>> = Arc::new(RwLock::new(Vec::new())); }

fn main() { run(LOCK.futurewrite(|mut v| { v.push(String::from("It works!")); LOCK.futureread(|v| -> Result<(), ()> { assert!(v.len() == 1 && v[0] == "It works!"); Ok(()) }) })); } ```