Closed TheLQ closed 10 years ago
Did you import iron::Plugin
? It provides the get
method on Request. Perhaps this could be clarified in the README.
Welp, it works now, thanks!
I agree the import really needs to be more prominent. Playing "will it compile?" games with the compiler will sort out all the other imports but iron::plugin == Request.get()
isn't very intuitive
Finding which traits give you which methods is always pretty annoying, I agree.
Just added a clarifying note to the README, so closing.
The example on the front page does not compile anymore
I've tried several fixes but the magic of typemap makes it really unintuitive.
Attempt 1 based on TypeMap's README:
let mutex = req.extensions.find::<Write<HitCounter, uint>>().unwrap();
Attempt 2:
let mutex = req.extensions::<Write<HitCounter, uint>>.find().unwrap();
Every other attempt fails with a similar error. My guess is the the type information is lost in all the casting and magic, but I have no idea where it is or how to fix it