Skip to content

builder for proto object may be more helperful #254

Description

@miaomiao1992

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions