You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and this trait should be exposed, thus the user can implement it. Type inference is not a problem at all, as proc macro suggested by #395 can insert a fully qualified path.
use rweb::{filters::BoxedFilter,*};implFromRequestforUser{typeFilter = BoxedFilter<(User,)>;fnnew() -> Self::Filter{// In real world, this can be changed to use Authorization headerheader::<String>("x-user-id").map(|id| User{ id }).boxed()}}structUser{id:String,}#[get("/")]fnindex(user:User) -> String{
user.id}
It also allows using filters::ws::Ws without any annotation and provides more natural syntax for forms.
With the help of a proc macro (#395), such trait will be very useful. I'm currently experimenting with it at kdy1/rweb#5.
Trait definition will be
and this trait should be exposed, thus the user can implement it. Type inference is not a problem at all, as proc macro suggested by #395 can insert a fully qualified path.
It also allows using
filters::ws::Ws
without any annotation and provides more natural syntax for forms.looks much more natural than
The text was updated successfully, but these errors were encountered: