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
attached to router using to_async. Nothing really fancy - just dropping the user state on logout. Before v0.6.1, the handler was synchronous, as discard returned plain Result. From 0.6.1 onward, discard returns a Pin<Box<dyn Future<Output = Result<(), SessionError>>>>. This is problematic, because the Future is not Send, so the future returned by logout_handler is also !Send and cannot be used in to_async.
i.e. making the Future also Send works and solves the problem. I am not sure whether this is the correct approach - do I miss something here? I'm only starting with async Rust and I don't really feel like I know how it works, so sorry in advance if I missed something obvious. :)
The text was updated successfully, but these errors were encountered:
Yep, it also looks like a simple omission (since other Futures are aliased, and the alias has Send). Do you want a PR from me maybe (I can also write some tests for discard, as noted in the comment), or do you want to tackle it yourself?
Hey there!
I stumbled on a following error. Consider the handler code:
attached to router using
to_async
. Nothing really fancy - just dropping the user state on logout. Before v0.6.1, the handler was synchronous, asdiscard
returned plainResult
. From 0.6.1 onward,discard
returns aPin<Box<dyn Future<Output = Result<(), SessionError>>>>
. This is problematic, because theFuture
is notSend
, so the future returned bylogout_handler
is also!Send
and cannot be used into_async
.Changing the signature of
discard
toi.e. making the
Future
alsoSend
works and solves the problem. I am not sure whether this is the correct approach - do I miss something here? I'm only starting with async Rust and I don't really feel like I know how it works, so sorry in advance if I missed something obvious. :)The text was updated successfully, but these errors were encountered: