#0.7.0: returning a string in a server function while also setting a header

1 messages · Page 1 of 1 (latest)

wicked oar
#

I'm setting mutiple headers by returning multiple SetHeader<SetCookie>>s in a tuple, but when I try and also return a String by including that in the tuple, I get errors:

the following trait bounds were not satisfied:
             `(SetHeader<SetCookie>, SetHeader<SetCookie>, std::string::String): FromResponse<_>`
             which is required by `&&&&ServerFnDecoder<std::result::Result<(SetHeader<SetCookie>, SetHeader<SetCookie>, std::string::String), dioxus::Error>>: MakeAxumResponse<(SetHeader<SetCookie>, SetHeader<SetCookie>, std::string::String), dioxus::Error, _>`
             `(SetHeader<SetCookie>, SetHeader<SetCookie>, std::string::String): DeserializeOwned`
             which is required by `&&&ServerFnDecoder<std::result::Result<(SetHeader<SetCookie>, SetHeader<SetCookie>, std::string::String), dioxus::Error>>: MakeAxumResponse<(SetHeader<SetCookie>, SetHeader<SetCookie>, std::string::String), dioxus::Error, ()>`
             `(SetHeader<SetCookie>, SetHeader<SetCookie>, std::string::String): Serialize`
             which is required by `&&&ServerFnDecoder<std::result::Result<(SetHeader<SetCookie>, SetHeader<SetCookie>, std::string::String), dioxus::Error>>: MakeAxumResponse<(SetHeader<SetCookie>, SetHeader<SetCookie>, std::string::String), dioxus::Error, ()>`

I've tried having this just be an axum endpoint that I add to the axum server directly, but ran into this issue, or something similar that also seems to affect rc.1.

GitHub

Fullstack app framework for web, desktop, and mobile. - DioxusLabs/dioxus