pub struct Customize { /* private fields */ }
Expand description
Specifies style of generated code.
Generated files can be customized using this proto
or using rustproto.proto
options.
Implementations§
source§impl Customize
impl Customize
sourcepub fn before(self, before: &str) -> Self
pub fn before(self, before: &str) -> Self
Insert code before the element in the generated file (e. g. serde annotations, see example here).
pub fn generate_accessors(self, generate_accessors: bool) -> Self
pub fn generate_getter(self, generate_getter: bool) -> Self
pub fn tokio_bytes(self, tokio_bytes: bool) -> Self
pub fn tokio_bytes_for_string(self, tokio_bytes_for_string: bool) -> Self
pub fn oneofs_non_exhaustive(self, non_exhaustive: bool) -> Self
sourcepub fn lite_runtime(self, lite_runtime: bool) -> Self
pub fn lite_runtime(self, lite_runtime: bool) -> Self
Generate code for “lite runtime”. Generated code contains no code for reflection. So the generated code (and more importantly, generated binary size) is smaller, but reflection, text format, JSON serialization won’t work.
Note when using protoc
plugin protoc-gen-rs
, the option name is just lite
.
sourcepub fn gen_mod_rs(self, gen_mod_rs: bool) -> Self
pub fn gen_mod_rs(self, gen_mod_rs: bool) -> Self
Generate mod.rs
with all the generated modules.
This option is on by default in rust-protobuf version 3.
sourcepub fn inside_protobuf(self, inside_protobuf: bool) -> Self
pub fn inside_protobuf(self, inside_protobuf: bool) -> Self
Generate code bundled in protobuf crate. Regular users don’t need this option.
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>
pub fn parse_from_parameter(parameter: &str) -> Result<Customize>
Parse customize options from a string passed via protoc flag.
Trait Implementations§
impl StructuralPartialEq for Customize
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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