mirror of
https://github.com/fafhrd91/actix-web
synced 2025-09-02 01:31:57 +02:00
update readme
This commit is contained in:
@@ -41,9 +41,8 @@ fn index(req: HttpRequest) -> Box<Future<Item=HttpResponse, Error=Error>> {
|
||||
|
||||
## Response with custom type
|
||||
|
||||
To return custom type directly from handler function `FromResponse` trait should be
|
||||
implemented for this type. Let's create response for custom type that
|
||||
serializes to `application/json` response:
|
||||
To return custom type directly from handler function type needs to implement `Responder` trait.
|
||||
Let's create response for custom type that serializes to `application/json` response:
|
||||
|
||||
```rust
|
||||
# extern crate actix;
|
||||
|
Reference in New Issue
Block a user