项目作者: actix

项目描述 :
Protobuf integration for actix web
高级语言: Rust
项目地址: git://github.com/actix/actix-protobuf.git
创建时间: 2018-03-11T15:54:39Z
项目社区:https://github.com/actix/actix-protobuf

开源协议:

下载


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

Protobuf support for actix-web framework.

NOTICE: This repository has been archived. Please visit https://github.com/actix/actix-extras instead.

Example

  1. use actix_protobuf::*;
  2. use actix_web::*;
  3. #[derive(Clone, PartialEq, Message)]
  4. pub struct MyObj {
  5. #[prost(int32, tag = "1")]
  6. pub number: i32,
  7. #[prost(string, tag = "2")]
  8. pub name: String,
  9. }
  10. async fn index(msg: ProtoBuf<MyObj>) -> Result<HttpResponse> {
  11. println!("model: {:?}", msg);
  12. HttpResponse::Ok().protobuf(msg.0) // <- send response
  13. }

See here for the complete example.

License

This project is licensed under either of

at your option.