Struct rhoast_client_v03::proto::scalapb::ScalaPbOptions
source · pub struct ScalaPbOptions {Show 24 fields
pub package_name: Option<String>,
pub flat_package: Option<bool>,
pub import: Vec<String>,
pub preamble: Vec<String>,
pub single_file: Option<bool>,
pub no_primitive_wrappers: Option<bool>,
pub primitive_wrappers: Option<bool>,
pub collection_type: Option<String>,
pub preserve_unknown_fields: Option<bool>,
pub object_name: Option<String>,
pub scope: Option<i32>,
pub lenses: Option<bool>,
pub retain_source_code_info: Option<bool>,
pub map_type: Option<String>,
pub no_default_values_in_constructor: Option<bool>,
pub enum_value_naming: Option<i32>,
pub enum_strip_prefix: Option<bool>,
pub bytes_type: Option<String>,
pub java_conversions: Option<bool>,
pub aux_message_options: Vec<AuxMessageOptions>,
pub aux_field_options: Vec<AuxFieldOptions>,
pub aux_enum_options: Vec<AuxEnumOptions>,
pub aux_enum_value_options: Vec<AuxEnumValueOptions>,
pub test_only_no_java_conversions: Option<bool>,
}
Fields§
§package_name: Option<String>
If set then it overrides the java_package and package.
flat_package: Option<bool>
If true, the compiler does not append the proto base file name into the generated package name. If false (the default), the generated scala package name is the package_name.basename where basename is the proto file name without the .proto extension.
import: Vec<String>
Adds the following imports at the top of the file (this is meant to provide implicit TypeMappers)
preamble: Vec<String>
Text to add to the generated scala file. This can be used only when single_file is true.
single_file: Option<bool>
If true, all messages and enums (but not services) will be written to a single Scala file.
no_primitive_wrappers: Option<bool>
By default, wrappers defined at https://github.com/google/protobuf/blob/master/src/google/protobuf/wrappers.proto, are mapped to an Option[T] where T is a primitive type. When this field is set to true, we do not perform this transformation.
primitive_wrappers: Option<bool>
DEPRECATED. In ScalaPB <= 0.5.47, it was necessary to explicitly enable
primitive_wrappers. This field remains here for backwards compatibility,
but it has no effect on generated code. It is an error to set both
primitive_wrappers
and no_primitive_wrappers
.
collection_type: Option<String>
Scala type to be used for repeated fields. If unspecified,
scala.collection.Seq
will be used.
preserve_unknown_fields: Option<bool>
If set to true, all generated messages in this file will preserve unknown fields.
object_name: Option<String>
If defined, sets the name of the file-level object that would be generated. This
object extends GeneratedFileObject
and contains descriptors, and list of message
and enum companions.
scope: Option<i32>
Experimental: scope to apply the given options.
lenses: Option<bool>
If true, lenses will be generated.
retain_source_code_info: Option<bool>
If true, then source-code info information will be included in the generated code - normally the source code info is cleared out to reduce code size. The source code info is useful for extracting source code location from the descriptors as well as comments.
map_type: Option<String>
Scala type to be used for maps. If unspecified,
scala.collection.immutable.Map
will be used.
no_default_values_in_constructor: Option<bool>
If true, no default values will be generated in message constructors.
enum_value_naming: Option<i32>
§enum_strip_prefix: Option<bool>
Indicate if prefix (enum name + optional underscore) should be removed in scala code Strip is applied before enum value naming changes.
bytes_type: Option<String>
Scala type to use for bytes fields.
java_conversions: Option<bool>
Enable java conversions for this file.
aux_message_options: Vec<AuxMessageOptions>
List of message options to apply to some messages.
aux_field_options: Vec<AuxFieldOptions>
List of message options to apply to some fields.
aux_enum_options: Vec<AuxEnumOptions>
List of message options to apply to some enums.
aux_enum_value_options: Vec<AuxEnumValueOptions>
List of enum value options to apply to some enum values.
test_only_no_java_conversions: Option<bool>
For use in tests only. Inhibit Java conversions even when when generator parameters request for it.
Implementations§
source§impl ScalaPbOptions
impl ScalaPbOptions
sourcepub fn package_name(&self) -> &str
pub fn package_name(&self) -> &str
Returns the value of package_name
, or the default value if package_name
is unset.
sourcepub fn flat_package(&self) -> bool
pub fn flat_package(&self) -> bool
Returns the value of flat_package
, or the default value if flat_package
is unset.
sourcepub fn single_file(&self) -> bool
pub fn single_file(&self) -> bool
Returns the value of single_file
, or the default value if single_file
is unset.
sourcepub fn primitive_wrappers(&self) -> bool
pub fn primitive_wrappers(&self) -> bool
Returns the value of primitive_wrappers
, or the default value if primitive_wrappers
is unset.
sourcepub fn no_primitive_wrappers(&self) -> bool
pub fn no_primitive_wrappers(&self) -> bool
Returns the value of no_primitive_wrappers
, or the default value if no_primitive_wrappers
is unset.
sourcepub fn collection_type(&self) -> &str
pub fn collection_type(&self) -> &str
Returns the value of collection_type
, or the default value if collection_type
is unset.
sourcepub fn preserve_unknown_fields(&self) -> bool
pub fn preserve_unknown_fields(&self) -> bool
Returns the value of preserve_unknown_fields
, or the default value if preserve_unknown_fields
is unset.
sourcepub fn object_name(&self) -> &str
pub fn object_name(&self) -> &str
Returns the value of object_name
, or the default value if object_name
is unset.
sourcepub fn scope(&self) -> OptionsScope
pub fn scope(&self) -> OptionsScope
Returns the enum value of scope
, or the default if the field is unset or set to an invalid enum value.
sourcepub fn set_scope(&mut self, value: OptionsScope)
pub fn set_scope(&mut self, value: OptionsScope)
Sets scope
to the provided enum value.
sourcepub fn lenses(&self) -> bool
pub fn lenses(&self) -> bool
Returns the value of lenses
, or the default value if lenses
is unset.
sourcepub fn retain_source_code_info(&self) -> bool
pub fn retain_source_code_info(&self) -> bool
Returns the value of retain_source_code_info
, or the default value if retain_source_code_info
is unset.
sourcepub fn map_type(&self) -> &str
pub fn map_type(&self) -> &str
Returns the value of map_type
, or the default value if map_type
is unset.
sourcepub fn no_default_values_in_constructor(&self) -> bool
pub fn no_default_values_in_constructor(&self) -> bool
Returns the value of no_default_values_in_constructor
, or the default value if no_default_values_in_constructor
is unset.
sourcepub fn enum_value_naming(&self) -> EnumValueNaming
pub fn enum_value_naming(&self) -> EnumValueNaming
Returns the enum value of enum_value_naming
, or the default if the field is unset or set to an invalid enum value.
sourcepub fn set_enum_value_naming(&mut self, value: EnumValueNaming)
pub fn set_enum_value_naming(&mut self, value: EnumValueNaming)
Sets enum_value_naming
to the provided enum value.
sourcepub fn enum_strip_prefix(&self) -> bool
pub fn enum_strip_prefix(&self) -> bool
Returns the value of enum_strip_prefix
, or the default value if enum_strip_prefix
is unset.
sourcepub fn bytes_type(&self) -> &str
pub fn bytes_type(&self) -> &str
Returns the value of bytes_type
, or the default value if bytes_type
is unset.
sourcepub fn java_conversions(&self) -> bool
pub fn java_conversions(&self) -> bool
Returns the value of java_conversions
, or the default value if java_conversions
is unset.
sourcepub fn test_only_no_java_conversions(&self) -> bool
pub fn test_only_no_java_conversions(&self) -> bool
Returns the value of test_only_no_java_conversions
, or the default value if test_only_no_java_conversions
is unset.
Trait Implementations§
source§impl Clone for ScalaPbOptions
impl Clone for ScalaPbOptions
source§fn clone(&self) -> ScalaPbOptions
fn clone(&self) -> ScalaPbOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ScalaPbOptions
impl Debug for ScalaPbOptions
source§impl Default for ScalaPbOptions
impl Default for ScalaPbOptions
source§impl Message for ScalaPbOptions
impl Message for ScalaPbOptions
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where B: BufMut, Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8, Global>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8, Global>where Self: Sized,
source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where B: BufMut, Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8, Global>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8, Global>where Self: Sized,
source§fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode<B>(buf: B) -> Result<Self, DecodeError>where B: Buf, Self: Default,
source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where B: Buf, Self: Default,
source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where B: Buf, Self: Sized,
self
. Read moresource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where B: Buf, Self: Sized,
self
.source§impl PartialEq<ScalaPbOptions> for ScalaPbOptions
impl PartialEq<ScalaPbOptions> for ScalaPbOptions
source§fn eq(&self, other: &ScalaPbOptions) -> bool
fn eq(&self, other: &ScalaPbOptions) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for ScalaPbOptions
Auto Trait Implementations§
impl RefUnwindSafe for ScalaPbOptions
impl Send for ScalaPbOptions
impl Sync for ScalaPbOptions
impl Unpin for ScalaPbOptions
impl UnwindSafe for ScalaPbOptions
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request