Alpha MwV2 vs MwV3 #185
-
Hey Oscar! I've been playing around with Rspc and I really like it. With the alpha version, how can I return a Result<> from a middleware function without having to use MwV3? I don't need to capture extra arguments in the middleware and can authenticate using headers/cookie. Are you able to provide an example? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The difference between Would be good for you to send through the code you've got cause I don't know if you're running on the latest crates.io release, main, or the v1-alpha. All of them handle stuff pretty differently. Can't wait till v1 is properly released but I just don't have the time right now to get it over the line. |
Beta Was this translation helpful? Give feedback.
The difference between
MwV2
&MwV3
isn't actually the arguments, it's just how the arguments are constrained. They both need the two arguments and the same function signature to be valid (The advantage of the unconstrained type is that you can provide non-closure types but this is mostly for super advanced stuff). The reasonMwV2
exists comes down to this (playground) and I am still working on a coming up with a solution to this because it's really not great DX but Rust makes it very difficult.Would be good for you to send through the code you've got cause I don't know if you're running on the latest crates.io release, main, or the v1-alpha. All of them handle stuff pretty differently. C…