reem / rust-modifier

Convenient chaining APIs for free
29 stars 9 forks source link

Collaborate on a library for this pattern? #1

Closed bvssvni closed 9 years ago

bvssvni commented 10 years ago

I'm working on piston-current https://github.com/pistondevelopers/current which will open up a new space of design for high level game libraries, by having the ability to set a "current" object of any concrete type.

The problem is that you can't call methods directly on current object, so by combining rust-modifier and piston-current, we can do this in piston game loops:

set::<Window>(Title("Hello"));

However, we also need a way to get stuff out of the objects easily:

let Title(text) = from::<Window>();

This is lacking in rust-modifier.

I will start reexport the traits from rust-modifier to make the libraries that uses rust-modifier work with Piston.

However, I hope we can collaborate on a library such that people don't have to include multiple modifier crates in their project.

reem commented 10 years ago

It looks like you've at least partially implemented this? I think you are basically looking for this + https://github.com/reem/rust-convertible and a bit of sugar using task-local-storage.

reem commented 9 years ago

I'm going to close this since that library is proceeding along already.