Crates.io | actix-protobuf |
lib.rs | actix-protobuf |
version | 0.11.0 |
source | src |
created_at | 2018-03-21 23:01:40.404935 |
updated_at | 2024-07-20 06:12:37.158107 |
description | Protobuf payload extractor for Actix Web |
homepage | https://actix.rs |
repository | https://github.com/actix/actix-extras |
max_upload_size | |
id | 56810 |
size | 28,405 |
Protobuf payload extractor for Actix Web.
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.
This project is licensed under either of
at your option.