#[non_exhaustive]pub struct Options {
pub strict_utf8_mapping: bool,
pub generate_json: bool,
pub extern_paths: Vec<(String, String)>,
pub emit_register_fn: bool,
}Expand description
Options for ConnectRPC code generation.
These control both the underlying buffa message generation and the ConnectRPC service binding generation.
Construct via Options { field: value, ..Options::default() }.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.strict_utf8_mapping: boolEmit Vec<u8>/&[u8] for proto string fields with
utf8_validation = NONE instead of String/&str. See
buffa_codegen::CodeGenConfig::strict_utf8_mapping.
generate_json: boolEmit serde::Serialize / serde::Deserialize derives and the proto3
JSON mapping helpers on generated message types. Required for the
Connect protocol’s JSON codec; disable only if you’re targeting
binary-only clients.
extern_paths: Vec<(String, String)>Map protobuf package prefixes to Rust module paths for message types.
Each entry is (proto_prefix, rust_path), e.g.
(".", "crate::proto") routes every type through crate::proto::....
More-specific prefixes win via longest-prefix-match, and the WKT
mapping (.google.protobuf -> ::buffa_types::...) is auto-injected.
Used by generate_services to bake absolute paths into service
stubs so they compile independently of co-generated message types.
Unused by generate_files (the unified super::-relative path).
emit_register_fn: boolEmit the per-file register_types(&mut TypeRegistry) function that
aggregates every message in the file. Default true. See
buffa_codegen::CodeGenConfig::emit_register_fn.
Set to false when multiple generated files are include!d into
the same module — the identically-named register_types fns would
otherwise collide. The per-message __*_JSON_ANY consts are still
emitted; only the aggregating function is suppressed.