pub struct CodeGeneratorRequest {
pub file_to_generate: Vec<String>,
pub parameter: Option<String>,
pub proto_file: Vec<FileDescriptorProto>,
pub compiler_version: MessageField<Version>,
pub special_fields: SpecialFields,
}
Expand description
An encoded CodeGeneratorRequest is written to the plugin’s stdin.
Fields§
§file_to_generate: Vec<String>
The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file’s descriptor will be included in proto_file, below.
parameter: Option<String>
The generator parameter passed on the command-line.
proto_file: Vec<FileDescriptorProto>
FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it.
protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc’s end – it will store all fields in memory at once before sending them to the plugin.
Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
compiler_version: MessageField<Version>
The version number of protocol compiler.
special_fields: SpecialFields
Implementations§
Source§impl CodeGeneratorRequest
impl CodeGeneratorRequest
pub fn new() -> CodeGeneratorRequest
pub fn parameter(&self) -> &str
pub fn clear_parameter(&mut self)
pub fn has_parameter(&self) -> bool
pub fn set_parameter(&mut self, v: String)
pub fn mut_parameter(&mut self) -> &mut String
pub fn take_parameter(&mut self) -> String
Trait Implementations§
Source§impl Clone for CodeGeneratorRequest
impl Clone for CodeGeneratorRequest
Source§fn clone(&self) -> CodeGeneratorRequest
fn clone(&self) -> CodeGeneratorRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CodeGeneratorRequest
impl Debug for CodeGeneratorRequest
Source§impl<'a> Default for &'a CodeGeneratorRequest
impl<'a> Default for &'a CodeGeneratorRequest
Source§fn default() -> &'a CodeGeneratorRequest
fn default() -> &'a CodeGeneratorRequest
Source§impl Default for CodeGeneratorRequest
impl Default for CodeGeneratorRequest
Source§fn default() -> CodeGeneratorRequest
fn default() -> CodeGeneratorRequest
Source§impl Display for CodeGeneratorRequest
impl Display for CodeGeneratorRequest
Source§impl Message for CodeGeneratorRequest
impl Message for CodeGeneratorRequest
Source§const NAME: &'static str = "CodeGeneratorRequest"
const NAME: &'static str = "CodeGeneratorRequest"
.proto
file. Read moreSource§fn is_initialized(&self) -> bool
fn is_initialized(&self) -> bool
true
for protobuf 3.Source§fn merge_from(&mut self, is: &mut CodedInputStream<'_>) -> Result<()>
fn merge_from(&mut self, is: &mut CodedInputStream<'_>) -> Result<()>
Source§fn compute_size(&self) -> u64
fn compute_size(&self) -> u64
Source§fn write_to_with_cached_sizes(
&self,
os: &mut CodedOutputStream<'_>,
) -> Result<()>
fn write_to_with_cached_sizes( &self, os: &mut CodedOutputStream<'_>, ) -> Result<()>
Source§fn special_fields(&self) -> &SpecialFields
fn special_fields(&self) -> &SpecialFields
Source§fn mut_special_fields(&mut self) -> &mut SpecialFields
fn mut_special_fields(&mut self) -> &mut SpecialFields
Source§fn new() -> CodeGeneratorRequest
fn new() -> CodeGeneratorRequest
Source§fn default_instance() -> &'static CodeGeneratorRequest
fn default_instance() -> &'static CodeGeneratorRequest
Source§fn parse_from(is: &mut CodedInputStream<'_>) -> Result<Self>
fn parse_from(is: &mut CodedInputStream<'_>) -> Result<Self>
Source§fn cached_size(&self) -> u32
fn cached_size(&self) -> u32
compute_size
. Read moreSource§fn write_to(&self, os: &mut CodedOutputStream<'_>) -> Result<()>
fn write_to(&self, os: &mut CodedOutputStream<'_>) -> Result<()>
Source§fn write_length_delimited_to(
&self,
os: &mut CodedOutputStream<'_>,
) -> Result<()>
fn write_length_delimited_to( &self, os: &mut CodedOutputStream<'_>, ) -> Result<()>
Source§fn write_length_delimited_to_vec(&self, vec: &mut Vec<u8>) -> Result<()>
fn write_length_delimited_to_vec(&self, vec: &mut Vec<u8>) -> Result<()>
Source§fn merge_from_bytes(&mut self, bytes: &[u8]) -> Result<()>
fn merge_from_bytes(&mut self, bytes: &[u8]) -> Result<()>
Source§fn parse_from_reader(reader: &mut dyn Read) -> Result<Self>
fn parse_from_reader(reader: &mut dyn Read) -> Result<Self>
Source§fn parse_from_bytes(bytes: &[u8]) -> Result<Self>
fn parse_from_bytes(bytes: &[u8]) -> Result<Self>
Source§fn check_initialized(&self) -> Result<()>
fn check_initialized(&self) -> Result<()>
Source§fn write_length_delimited_to_writer(&self, w: &mut dyn Write) -> Result<()>
fn write_length_delimited_to_writer(&self, w: &mut dyn Write) -> Result<()>
Source§fn write_length_delimited_to_bytes(&self) -> Result<Vec<u8>>
fn write_length_delimited_to_bytes(&self) -> Result<Vec<u8>>
Source§fn unknown_fields(&self) -> &UnknownFields
fn unknown_fields(&self) -> &UnknownFields
Source§fn mut_unknown_fields(&mut self) -> &mut UnknownFields
fn mut_unknown_fields(&mut self) -> &mut UnknownFields
Source§impl MessageFull for CodeGeneratorRequest
impl MessageFull for CodeGeneratorRequest
Source§fn descriptor() -> MessageDescriptor
fn descriptor() -> MessageDescriptor
Source§fn reflect_eq(&self, other: &Self, mode: &ReflectEqMode) -> bool
fn reflect_eq(&self, other: &Self, mode: &ReflectEqMode) -> bool
Source§impl PartialEq for CodeGeneratorRequest
impl PartialEq for CodeGeneratorRequest
Source§impl ProtobufValue for CodeGeneratorRequest
impl ProtobufValue for CodeGeneratorRequest
Source§type RuntimeType = RuntimeTypeMessage<CodeGeneratorRequest>
type RuntimeType = RuntimeTypeMessage<CodeGeneratorRequest>
impl StructuralPartialEq for CodeGeneratorRequest
Auto Trait Implementations§
impl !Freeze for CodeGeneratorRequest
impl RefUnwindSafe for CodeGeneratorRequest
impl Send for CodeGeneratorRequest
impl Sync for CodeGeneratorRequest
impl Unpin for CodeGeneratorRequest
impl UnwindSafe for CodeGeneratorRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<M> MessageDyn for Mwhere
M: MessageFull,
impl<M> MessageDyn for Mwhere
M: MessageFull,
Source§fn descriptor_dyn(&self) -> MessageDescriptor
fn descriptor_dyn(&self) -> MessageDescriptor
Source§fn merge_from_dyn(&mut self, is: &mut CodedInputStream<'_>) -> Result<(), Error>
fn merge_from_dyn(&mut self, is: &mut CodedInputStream<'_>) -> Result<(), Error>
Source§fn write_to_with_cached_sizes_dyn(
&self,
os: &mut CodedOutputStream<'_>,
) -> Result<(), Error>
fn write_to_with_cached_sizes_dyn( &self, os: &mut CodedOutputStream<'_>, ) -> Result<(), Error>
Source§fn compute_size_dyn(&self) -> u64
fn compute_size_dyn(&self) -> u64
Source§fn is_initialized_dyn(&self) -> bool
fn is_initialized_dyn(&self) -> bool
true
for protobuf 3.