pub struct CodeGeneratorResponse {
pub error: Option<String>,
pub supported_features: Option<u64>,
pub minimum_edition: Option<i32>,
pub maximum_edition: Option<i32>,
pub file: Vec<File>,
/* private fields */
}Expand description
The plugin writes an encoded CodeGeneratorResponse to stdout.
Fields§
§error: Option<String>Error message. If non-empty, code generation failed. The plugin process should exit with status code zero even if it reports an error in this way.
This should be used to indicate errors in .proto files which prevent the code generator from generating correct code. Errors which indicate a problem in protoc itself – such as the input CodeGeneratorRequest being unparseable – should be reported by writing a message to stderr and exiting with a non-zero status code.
Field 1: error
supported_features: Option<u64>A bitmask of supported features that the code generator supports. This is a bitwise “or” of values from the Feature enum.
Field 2: supported_features
minimum_edition: Option<i32>The minimum edition this plugin supports. This will be treated as an Edition enum, but we want to allow unknown values. It should be specified according the edition enum value, not the edition number. Only takes effect for plugins that have FEATURE_SUPPORTS_EDITIONS set.
Field 3: minimum_edition
maximum_edition: Option<i32>The maximum edition this plugin supports. This will be treated as an Edition enum, but we want to allow unknown values. It should be specified according the edition enum value, not the edition number. Only takes effect for plugins that have FEATURE_SUPPORTS_EDITIONS set.
Field 4: maximum_edition
file: Vec<File>Field 15: file
Implementations§
Trait Implementations§
Source§impl Clone for CodeGeneratorResponse
impl Clone for CodeGeneratorResponse
Source§fn clone(&self) -> CodeGeneratorResponse
fn clone(&self) -> CodeGeneratorResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CodeGeneratorResponse
impl Debug for CodeGeneratorResponse
Source§impl Default for CodeGeneratorResponse
impl Default for CodeGeneratorResponse
Source§fn default() -> CodeGeneratorResponse
fn default() -> CodeGeneratorResponse
Source§impl DefaultInstance for CodeGeneratorResponse
impl DefaultInstance for CodeGeneratorResponse
Source§fn default_instance() -> &'static CodeGeneratorResponse
fn default_instance() -> &'static CodeGeneratorResponse
Source§impl ExtensionSet for CodeGeneratorResponse
impl ExtensionSet for CodeGeneratorResponse
Source§const PROTO_FQN: &'static str = "google.protobuf.compiler.CodeGeneratorResponse"
const PROTO_FQN: &'static str = "google.protobuf.compiler.CodeGeneratorResponse"
"google.protobuf.FieldOptions". Read moreSource§fn unknown_fields(&self) -> &UnknownFields
fn unknown_fields(&self) -> &UnknownFields
Source§fn unknown_fields_mut(&mut self) -> &mut UnknownFields
fn unknown_fields_mut(&mut self) -> &mut UnknownFields
Source§fn extension<C>(&self, ext: &Extension<C>) -> <C as ExtensionCodec>::Outputwhere
C: ExtensionCodec,
fn extension<C>(&self, ext: &Extension<C>) -> <C as ExtensionCodec>::Outputwhere
C: ExtensionCodec,
Source§fn set_extension<C>(
&mut self,
ext: &Extension<C>,
value: <C as ExtensionCodec>::Value,
)where
C: ExtensionCodec,
fn set_extension<C>(
&mut self,
ext: &Extension<C>,
value: <C as ExtensionCodec>::Value,
)where
C: ExtensionCodec,
Source§fn has_extension<C>(&self, ext: &Extension<C>) -> boolwhere
C: ExtensionCodec,
fn has_extension<C>(&self, ext: &Extension<C>) -> boolwhere
C: ExtensionCodec,
true if any record at the extension’s field number is present. Read moreSource§fn clear_extension<C>(&mut self, ext: &Extension<C>)where
C: ExtensionCodec,
fn clear_extension<C>(&mut self, ext: &Extension<C>)where
C: ExtensionCodec,
Source§fn extension_or_default<C>(
&self,
ext: &Extension<C>,
) -> <C as ExtensionCodec>::Valuewhere
C: ExtensionCodec<Output = Option<<C as ExtensionCodec>::Value>>,
<C as ExtensionCodec>::Value: Default,
fn extension_or_default<C>(
&self,
ext: &Extension<C>,
) -> <C as ExtensionCodec>::Valuewhere
C: ExtensionCodec<Output = Option<<C as ExtensionCodec>::Value>>,
<C as ExtensionCodec>::Value: Default,
[default = ...]
value if absent, or the type’s Default if no proto default was declared. Read moreSource§impl Message for CodeGeneratorResponse
impl Message for CodeGeneratorResponse
Source§fn compute_size(&self, __cache: &mut SizeCache) -> u32
fn compute_size(&self, __cache: &mut SizeCache) -> u32
Returns the total encoded size in bytes.
The result is a u32; the protobuf specification requires all
messages to fit within 2 GiB (2,147,483,647 bytes), so a
compliant message will never overflow this type.
Source§fn write_to(&self, __cache: &mut SizeCache, buf: &mut impl BufMut)
fn write_to(&self, __cache: &mut SizeCache, buf: &mut impl BufMut)
cache (populated by a prior
compute_size call on the same cache). Read moreSource§fn merge_field(
&mut self,
tag: Tag,
buf: &mut impl Buf,
depth: u32,
) -> Result<(), DecodeError>
fn merge_field( &mut self, tag: Tag, buf: &mut impl Buf, depth: u32, ) -> Result<(), DecodeError>
buf. Read moreSource§fn encode(&self, buf: &mut impl BufMut)
fn encode(&self, buf: &mut impl BufMut)
Source§fn encode_with_cache(&self, cache: &mut SizeCache, buf: &mut impl BufMut)
fn encode_with_cache(&self, cache: &mut SizeCache, buf: &mut impl BufMut)
SizeCache, for
reuse across many encodes in a hot loop. Clears the cache first.Source§fn encoded_len(&self) -> u32
fn encoded_len(&self) -> u32
Source§fn encode_length_delimited(&self, buf: &mut impl BufMut)
fn encode_length_delimited(&self, buf: &mut impl BufMut)
Source§fn encode_to_bytes(&self) -> Bytes
fn encode_to_bytes(&self) -> Bytes
bytes::Bytes. Read moreSource§fn decode(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
fn decode(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
Source§fn decode_from_slice(data: &[u8]) -> Result<Self, DecodeError>where
Self: Sized,
fn decode_from_slice(data: &[u8]) -> Result<Self, DecodeError>where
Self: Sized,
Source§fn decode_length_delimited(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
fn decode_length_delimited(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
Source§fn merge_to_limit(
&mut self,
buf: &mut impl Buf,
depth: u32,
limit: usize,
) -> Result<(), DecodeError>
fn merge_to_limit( &mut self, buf: &mut impl Buf, depth: u32, limit: usize, ) -> Result<(), DecodeError>
Source§fn merge_group(
&mut self,
buf: &mut impl Buf,
depth: u32,
field_number: u32,
) -> Result<(), DecodeError>
fn merge_group( &mut self, buf: &mut impl Buf, depth: u32, field_number: u32, ) -> Result<(), DecodeError>
buf, reading fields until an
EndGroup tag with the given field_number is encountered. Read moreSource§fn merge(&mut self, buf: &mut impl Buf, depth: u32) -> Result<(), DecodeError>
fn merge(&mut self, buf: &mut impl Buf, depth: u32) -> Result<(), DecodeError>
Source§fn merge_from_slice(&mut self, data: &[u8]) -> Result<(), DecodeError>
fn merge_from_slice(&mut self, data: &[u8]) -> Result<(), DecodeError>
Source§fn merge_length_delimited(
&mut self,
buf: &mut impl Buf,
depth: u32,
) -> Result<(), DecodeError>
fn merge_length_delimited( &mut self, buf: &mut impl Buf, depth: u32, ) -> Result<(), DecodeError>
Source§impl PartialEq for CodeGeneratorResponse
impl PartialEq for CodeGeneratorResponse
Source§fn eq(&self, other: &CodeGeneratorResponse) -> bool
fn eq(&self, other: &CodeGeneratorResponse) -> bool
self and other values to be equal, and is used by ==.