Struct protobuf::json::PrintOptions
source · [−]pub struct PrintOptions {
pub enum_values_int: bool,
pub proto_field_name: bool,
pub always_output_default_values: bool,
pub _future_options: (),
}
Expand description
Options for printing JSON to string
Examples
use protobuf::json;
let print_options = json::PrintOptions {
enum_values_int: true,
..Default::default()
};
Fields
enum_values_int: bool
Use ints instead of strings for enums.
Note both string or int can be parsed.
proto_field_name: bool
Use protobuf field names instead of lowerCamelCase
which is used by default.
Note both names are supported when JSON is parsed.
always_output_default_values: bool
Output field default values.
_future_options: ()
Prevent initializing PrintOptions
enumerating all field.
Trait Implementations
sourceimpl Clone for PrintOptions
impl Clone for PrintOptions
sourcefn clone(&self) -> PrintOptions
fn clone(&self) -> PrintOptions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PrintOptions
impl Debug for PrintOptions
sourceimpl Default for PrintOptions
impl Default for PrintOptions
sourcefn default() -> PrintOptions
fn default() -> PrintOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for PrintOptions
impl Send for PrintOptions
impl Sync for PrintOptions
impl Unpin for PrintOptions
impl UnwindSafe for PrintOptions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more