-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid intermediate JSON AST creation #1
base: master
Are you sure you want to change the base?
Conversation
fn serve_ws( | ||
&self, | ||
ctx: Ctx, | ||
raw_req: Value, | ||
service_id: &str, | ||
) -> BoxStream<'static, Result<Value, ErrorKind>>; | ||
) -> BoxStream<'static, Result<Resp, ErrorKind>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return the Serializable
instead of the AST
.map(|resp_result| { | ||
resp_result | ||
.map(|resp| { | ||
serde_json::to_value(&resp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
skip this step
&self, | ||
_ctx: (), | ||
req: Self::Req, | ||
) -> BoxStream<'static, Result<Self::Resp, String>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like we need to box Self::Resp
here but that fails with
the trait
formats::_::serde::Serializecannot be made into an object
formats::::_serde::Serializecannot be made into an objectrustc(E0038)
which https://crates.io/crates/erased-serde might solve.
let services = Arc::new(maplit::btreemap! {"test" => TestService::new().boxed()}); | ||
let services = Arc::new(maplit::btreemap! { | ||
"test" => TestService::new().boxed(), | ||
"test2" => TestService2::new().boxed(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this now fails as the return type of serve
differs.
No description provided.