Crates.io | actix-protobuf |
lib.rs | actix-protobuf |
version | 0.10.0 |
source | src |
created_at | 2018-03-21 23:01:40.404935 |
updated_at | 2023-09-16 02:09:20.908579 |
description | Protobuf payload extractor for Actix Web |
homepage | https://actix.rs |
repository | https://github.com/actix/actix-extras.git |
max_upload_size | |
id | 56810 |
size | 27,556 |
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.