prost-msg-build
build prost struct with msg id so as to realize type judgment
message Fail{
enum MsgId { None=0;Id = 150002; }
int64 number=1;
string message=2;
}
auto impl MsgId and const fn
pub const FAIL_ID: i32 = get_msg_id;
///get all msg type id
pub const
about prost-build
prost-build
prost-build makes it easy to generate Rust code from .proto files as part of
a Cargo build. See the crate documentation for examples
of how to integrate prost-build into a Cargo project.
protoc
prost-build uses protoc to parse the proto files. There are two ways to make protoc
available for prost-build:
- Include
protocin yourPATH. This can be done by following theprotocinstall instructions. - Pass the
PROTOC=<my/path/to/protoc>environment variable with the path toprotoc.
License
prost-build is distributed under the terms of the Apache License (Version 2.0).
See LICENSE for details.
Copyright 2017 Dan Burkert