Ogeon / rustful

[OUTDATED] A light HTTP framework for Rust
https://docs.rs/rustful
Apache License 2.0
862 stars 51 forks source link

Router composition #96

Closed Ogeon closed 8 years ago

Ogeon commented 8 years ago

This makes the library support composable routers and closes #86. The Router trait is changed to make it easier to have routers within routers, by taking part of the routing state as an argument to find. TreeRouter is changed to support inner routers, and the method routing and variable parts are extracted into MethodRuter and Variables. These being together is still favored by the TreeRouter::new() and TreeRouter::from_iter(...) methods, by creating a TreeRouter<MethodRouter<Variables<H>>> instead of just a TreeRouter<T>.

This is a breaking change, since it changes the Router trait and the composition of TreeRouter. It will, however, not be noticeable by everyone, since the basic behavior is the same.

Ogeon commented 8 years ago

I'm still not done porting router merging, and there's still a bit more documenting left to do.

Ogeon commented 8 years ago

This took another decomposition turn, but I think this is all, now. I have some more abstraction plans, but those are for an other time.

Ogeon commented 8 years ago

@homu r+

homu commented 8 years ago

:pushpin: Commit 2a25283 has been approved by Ogeon

homu commented 8 years ago

:hourglass: Testing commit 2a25283 with merge 68ab597...

homu commented 8 years ago

:sunny: Test successful - status