You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0277]: the size for values of type [u8] cannot be known at compilation time
externcrate serde_json;use futures::{Future,Stream};#[derive(Serialize,Deserialize)]structMyObj{name:String,number:i32}fnindex(req:&HttpRequest) -> Box<Future<Item=HttpResponse,Error=Error>>{// `concat2` will asynchronously read each chunk of the request body and// return a single, concatenated, chunk
req.concat2()// `Future::from_err` acts like `?` in that it coerces the error type from// the future into the final error type.from_err()// `Future::and_then` can be used to merge an asynchronous workflow with a// synchronous workflow.and_then(|body| {let obj = serde_json::from_slice::<MyObj>(&body)?;Ok(HttpResponse::Ok().json(obj))}).responder()}
The text was updated successfully, but these errors were encountered:
error[E0277]: the size for values of type
[u8]
cannot be known at compilation timeThe text was updated successfully, but these errors were encountered: