Replies: 7 comments
-
could you explain what is “lazily extract”? |
Beta Was this translation helpful? Give feedback.
-
i.e. extract in the handler. But actually it seems I have mistaken the idea of zero copy deserialzation, actually I want some method that bind the lifetime to
|
Beta Was this translation helpful? Give feedback.
-
you need to load body in any case, then you can do whatever you need |
Beta Was this translation helpful? Give feedback.
-
But why the builtin extractor is designed to only support self-owned struct, I wonder if changing the generic lifetime to below would be a better approach impl<'de, T, Err: ErrorRenderer> FromRequest<Err> for Json<T>
where
T: Deserialize<'de>
{ |
Beta Was this translation helpful? Give feedback.
-
lifetime would complicate definition |
Beta Was this translation helpful? Give feedback.
-
you can always take Payload and use whatever extraction method you need |
Beta Was this translation helpful? Give feedback.
-
Ok, Thanks |
Beta Was this translation helpful? Give feedback.
-
In the framework I used previously, I could lazily extract data from the body using the builtin method. However, in ntex, there seems to be no way to achieve this simply. I wonder if ntex provides such a method or do I have to implement it myself?
Beta Was this translation helpful? Give feedback.
All reactions