1
0
mirror of https://github.com/actix/examples synced 2025-06-26 17:17:42 +02:00

v3 examples (#364)

This commit is contained in:
Rob Ede
2020-09-12 16:49:45 +01:00
committed by GitHub
parent 3f2b2708c3
commit 49e29a5751
112 changed files with 251 additions and 333 deletions

View File

@ -8,6 +8,7 @@ use actix_web::*;
pub struct MyObj {
#[prost(int32, tag = "1")]
pub number: i32,
#[prost(string, tag = "2")]
pub name: String,
}
@ -17,7 +18,7 @@ async fn index(msg: ProtoBuf<MyObj>) -> Result<HttpResponse> {
HttpResponse::Ok().protobuf(msg.0) // <- send response
}
#[actix_rt::main]
#[actix_web::main]
async fn main() -> std::io::Result<()> {
std::env::set_var("RUST_LOG", "actix_web=debug,actix_server=info");
env_logger::init();