Struct Customize

Source
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

Source

pub fn update_with(&mut self, that: &Customize)

Update fields of self with fields defined in other customize

Source

pub fn set_defaults_from(&mut self, other: &Customize)

Update unset fields of self with fields from other customize

Source

pub fn parse_from_parameter( parameter: &str, ) -> Result<Customize, CustomizeParseParameterError>

Parse customize options from a string passed via protoc flag.

Trait Implementations§

Source§

impl Clone for Customize

Source§

fn clone(&self) -> Customize

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 Customize

Source§

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

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

impl Default for Customize

Source§

fn default() -> Customize

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

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.