pub struct Customize {
pub expose_oneof: Option<bool>,
pub expose_fields: Option<bool>,
pub generate_accessors: Option<bool>,
pub carllerche_bytes_for_bytes: Option<bool>,
pub carllerche_bytes_for_string: Option<bool>,
pub serde_derive: Option<bool>,
pub serde_derive_cfg: Option<String>,
pub serde_rename_all: Option<String>,
pub lite_runtime: Option<bool>,
pub gen_mod_rs: Option<bool>,
pub inside_protobuf: Option<bool>,
pub _future_options: (),
}
Expand description
Specifies style of generated code.
Fields§
§expose_oneof: Option<bool>
Make oneof enum public.
expose_fields: Option<bool>
When true all fields are public, and accessors are not generated
generate_accessors: Option<bool>
When false, get_
, set_
, mut_
etc. accessors are not generated
carllerche_bytes_for_bytes: Option<bool>
Use bytes::Bytes
for bytes
fields
carllerche_bytes_for_string: Option<bool>
Use bytes::Bytes
for string
fields
serde_derive: Option<bool>
Implement serde_derive for messages
serde_derive_cfg: Option<String>
When serde_derive
is set, serde annotations will be guarded with #[cfg(cfg, ...)]
.
serde_rename_all: Option<String>
When serde_derive
is set, use attribute rename_all
lite_runtime: Option<bool>
Enable lite runtime
gen_mod_rs: Option<bool>
Generate mod.rs
in the output directory.
This option allows inclusion of generated files from cargo output directory.
This option will likely be on by default in rust-protobuf version 3.
inside_protobuf: Option<bool>
Used internally to generate protos bundled in protobuf crate
like descriptor.proto
_future_options: ()
Make sure Customize
is always used with ..Default::default()
for future compatibility.
Implementations§
Source§impl Customize
impl Customize
Sourcepub fn update_with(&mut self, that: &Customize)
pub fn update_with(&mut self, that: &Customize)
Update fields of self with fields defined in other customize
Sourcepub fn set_defaults_from(&mut self, other: &Customize)
pub fn set_defaults_from(&mut self, other: &Customize)
Update unset fields of self with fields from other customize
Sourcepub fn parse_from_parameter(
parameter: &str,
) -> Result<Customize, CustomizeParseParameterError>
pub fn parse_from_parameter( parameter: &str, ) -> Result<Customize, CustomizeParseParameterError>
Parse customize options from a string passed via protoc flag.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Customize
impl RefUnwindSafe for Customize
impl Send for Customize
impl Sync for Customize
impl Unpin for Customize
impl UnwindSafe for Customize
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more