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

source

pub fn package_name(&self) -> &str

Returns the value of package_name, or the default value if package_name is unset.

source

pub fn flat_package(&self) -> bool

Returns the value of flat_package, or the default value if flat_package is unset.

source

pub fn single_file(&self) -> bool

Returns the value of single_file, or the default value if single_file is unset.

source

pub fn primitive_wrappers(&self) -> bool

Returns the value of primitive_wrappers, or the default value if primitive_wrappers is unset.

source

pub fn no_primitive_wrappers(&self) -> bool

Returns the value of no_primitive_wrappers, or the default value if no_primitive_wrappers is unset.

source

pub fn collection_type(&self) -> &str

Returns the value of collection_type, or the default value if collection_type is unset.

source

pub fn preserve_unknown_fields(&self) -> bool

Returns the value of preserve_unknown_fields, or the default value if preserve_unknown_fields is unset.

source

pub fn object_name(&self) -> &str

Returns the value of object_name, or the default value if object_name is unset.

source

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.

source

pub fn set_scope(&mut self, value: OptionsScope)

Sets scope to the provided enum value.

source

pub fn lenses(&self) -> bool

Returns the value of lenses, or the default value if lenses is unset.

source

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.

source

pub fn map_type(&self) -> &str

Returns the value of map_type, or the default value if map_type is unset.

source

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.

source

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.

source

pub fn set_enum_value_naming(&mut self, value: EnumValueNaming)

Sets enum_value_naming to the provided enum value.

source

pub fn enum_strip_prefix(&self) -> bool

Returns the value of enum_strip_prefix, or the default value if enum_strip_prefix is unset.

source

pub fn bytes_type(&self) -> &str

Returns the value of bytes_type, or the default value if bytes_type is unset.

source

pub fn java_conversions(&self) -> bool

Returns the value of java_conversions, or the default value if java_conversions is unset.

source

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

source§

fn clone(&self) -> ScalaPbOptions

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ScalaPbOptions

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ScalaPbOptions

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Message for ScalaPbOptions

source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
source§

fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where B: BufMut, Self: Sized,

Encodes the message to a buffer. Read more
source§

fn encode_to_vec(&self) -> Vec<u8, Global>where Self: Sized,

Encodes the message to a newly allocated buffer.
source§

fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where B: BufMut, Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8, Global>where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
source§

fn decode<B>(buf: B) -> Result<Self, DecodeError>where B: Buf, Self: Default,

Decodes an instance of the message from a buffer. Read more
source§

fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where B: Buf, Self: Default,

Decodes a length-delimited instance of the message from the buffer.
source§

fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where B: Buf, Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
source§

fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where B: Buf, Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
source§

impl PartialEq<ScalaPbOptions> for ScalaPbOptions

source§

fn eq(&self, other: &ScalaPbOptions) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for ScalaPbOptions

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more