quick-protobuf icon indicating copy to clipboard operation
quick-protobuf copied to clipboard

builder for proto object may be more helperful

Open miaomiao1992 opened this issue 6 months ago • 0 comments

this is my proto:

syntax = "proto3";

message GetRequest { string name = 1; int32 age = 2; repeated string features = 3; }

this is my rs files: let req = GetRequest { name: Cow::Borrowed("name1"), age: 11, features: vec![Cow::Borrowed("features 1")], };

if wo have a builder, we can

let req=GetRequestBuilder::default() .name("name1") .age(11) .features(&["features 1"]) .build();

Is this easier?

miaomiao1992 avatar Jan 14 '24 05:01 miaomiao1992