Skip to content

flip111/actix-protobuf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.0)  // <- send response
}

License

This project is licensed under either of

at your option.

About

Protobuf integration for actix web

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%