protobuf-codegen 2.28.0

Code generator for rust-protobuf. Includes a library and `protoc-gen-rust` binary. See `protoc-rust` and `protobuf-codegen-pure` crates.
Documentation
1
2
3
4
5
6
7
8
9
use code_writer::CodeWriter;
use Customize;

/// Write serde attr according to specified codegen option.
pub fn write_serde_attr(w: &mut CodeWriter, customize: &Customize, attr: &str) {
    if customize.serde_derive.unwrap_or(false) {
        w.write_line(&format!("#[cfg_attr(feature = \"with-serde\", {})]", attr));
    }
}