iron / persistent

Middleware for sharing data between requests
43 stars 29 forks source link

Work with typemap #23

Closed duelinmarkers closed 10 years ago

duelinmarkers commented 10 years ago

Here's a way of making iron/persistent work with the recent change to use typemap for request extensions. I don't know if you already have something else in mind.

It requires the phantom key type to impl Assoc<Arc<RWLock<D>>>, which is a bit ugly, but only makes explicit dependencies that were already there.

reem commented 10 years ago

Thanks! Can you add rust-typemap to the Cargo.toml here, this works because Iron depends on it so it ends up in /target/deps, but I'd rather the dependency was made explicit.

This crate needs to be reworked pretty significantly, but it's good to have it build again for now.

duelinmarkers commented 10 years ago

There you go.