1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-27 09:12:57 +01:00
Go to file
2020-01-25 02:45:24 +09:00
examples/prost-example Update example (#12) 2020-01-25 02:39:32 +09:00
src Update dependencies and bump up version to 0.5 (#11) 2020-01-24 15:41:57 +09:00
.gitignore first commit 2018-03-13 00:21:49 +08:00
.travis.yml Update example (#12) 2020-01-25 02:39:32 +09:00
Cargo.toml Update dependencies and bump up version to 0.5 (#11) 2020-01-24 15:41:57 +09:00
CHANGES.md Update changelog (#13) 2020-01-25 02:45:24 +09:00
README.md Update example (#12) 2020-01-25 02:39:32 +09:00
rustfmt.toml Normalizing code formatting based on actix-web style 2019-05-21 21:39:48 +02:00

Actix-web ProtoBuf Build Status codecov crates.io Join the chat at https://gitter.im/actix/actix

Protobuf support for actix-web framework.

Example

use actix_protobuf::*;
use actix_web::*;

#[derive(Clone, PartialEq, Message)]
pub struct MyObj {
    #[prost(int32, tag = "1")]
    pub number: i32,
    #[prost(string, tag = "2")]
    pub name: String,
}

async fn index(msg: ProtoBuf<MyObj>) -> Result<HttpResponse> {
    println!("model: {:?}", msg);
    HttpResponse::Ok().protobuf(msg.0) // <- send response
}

See here for the complete example.

License

This project is licensed under either of

at your option.