actix-protobuf 0.2.0

Protobuf support for actix-web framework.
Documentation

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_web::{HttpResponse, Result};
use actix_protobuf::ProtoBuf;

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

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

License

This project is licensed under either of

at your option.