Closed stan-irl closed 1 year ago
Nope. withf
can't possibly pass arguments by ownership, because then the arguments wouldn't be available for a subsequent returner, like .returning()
. I suggest you:
withf
, and instead do all of your logic in returning
, orok no worries. this is great info - I will just panic in the returner. for now thats good enough. thanks for the quick response!
Im trying to mock out a grpc service interface at the moment but its not currently possible to access tonic request fields without calling
req.into_inner()
which consumes the request: https://docs.rs/tonic/latest/tonic/struct.Request.html#method.into_inner. Its also not possible to clone the request. This means its not possible to match withwithf
.This pattern seems to be pretty consistent across the board. Its the same in hyper: https://github.com/hyperium/hyper/issues/1300.
I think matching against requests is a pretty common use case for this library. Is there any other way to achieve this? or would it be possible to support it?