DioxusLabs / dioxus

Fullstack GUI library for web, desktop, mobile, and more.
https://dioxuslabs.com
Apache License 2.0
19.33k stars 736 forks source link

Accept RKYV archive for fullstack as answer? #2206

Closed XavDesbordes closed 3 months ago

XavDesbordes commented 3 months ago

Hi, According to https://dioxuslabs.com/learn/0.5/reference/fullstack/server_functions, an answer must be serializable by serde.

For people using binary protocols (Rkyv, others) it implies a Serialization/Deserialization first before, which may be costly. Alignedvec would help at the very least to avoid this.

Any opinion?

ealmloff commented 3 months ago

That page is a bit out of date. Return values can now choose any of these codecs including rkyv by setting the output encoding. Here is an example that uses the streaming text encoding: https://github.com/DioxusLabs/dioxus/blob/0850dcba5e91912ac9de1b02443cebd9b8ec2349/packages/fullstack/examples/axum-streaming/src/main.rs#L26

XavDesbordes commented 3 months ago

Nice, that's great! thanks!