impl Responder for String conflict #1952
Answered
by
fakeshadow
SardineFish
asked this question in
Q&A
-
I want to implement #[get("/foo")]
fn foo() -> u32 { }
#[get("/bar")]
fn bar() -> String { }
#[get("/baz")]
fn baz() -> Option<MyData, MyError> { }
impl Responder for u32 {} // ...
impl Responder for String {} // ...
impl Responder for Option<MyData, MyError> {} // ... But some was conflict with the implement in crate Is there other or better way to implement some thing like post processing for data returned by handler? |
Beta Was this translation helpful? Give feedback.
Answered by
fakeshadow
Feb 4, 2021
Replies: 1 comment 9 replies
-
wrap your string in a new type and impl responder for it. |
Beta Was this translation helpful? Give feedback.
9 replies
Answer selected by
robjtede
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
wrap your string in a new type and impl responder for it.