[−][src]Struct ron::ser::PrettyConfig
Pretty serializer configuration.
Examples
use ron::ser::PrettyConfig; let my_config = PrettyConfig::new() .with_depth_limit(4) // definitely superior (okay, just joking) .with_indentor("\t".to_owned());
Fields
depth_limit: usize
Limit the pretty-ness up to the given depth.
new_line: String
New line string
indentor: String
Indentation string
separate_tuple_members: bool
Separate tuple members with indentation
enumerate_arrays: bool
Enumerate array items in comments
decimal_floats: bool
Always include the decimal in floats
extensions: Extensions
Enable extensions. Only configures 'implicit_some' for now.
Implementations
impl PrettyConfig
[src]
pub fn new() -> Self
[src]
Creates a default PrettyConfig
.
pub fn with_depth_limit(self, depth_limit: usize) -> Self
[src]
Limits the pretty-formatting based on the number of indentations. I.e., with a depth limit of 5, starting with an element of depth (indentation level) 6, everything will be put into the same line, without pretty formatting.
Default: std::usize::MAX
pub fn with_new_line(self, new_line: String) -> Self
[src]
Configures the newlines used for serialization.
Default: \r\n
on Windows, \n
otherwise
pub fn with_indentor(self, indentor: String) -> Self
[src]
Configures the string sequence used for indentation.
Default: 4 spaces
pub fn with_separate_tuple_members(self, separate_tuple_members: bool) -> Self
[src]
Configures whether tuples are single- or multi-line.
If set to true
, tuples will have their fields indented and in new
lines. If set to false
, tuples will be serialized without any
newlines or indentations.
Default: false
pub fn with_enumerate_arrays(self, enumerate_arrays: bool) -> Self
[src]
Configures whether a comment shall be added to every array element, indicating the index.
Default: false
pub fn with_decimal_floats(self, decimal_floats: bool) -> Self
[src]
Configures whether floats should always include a decimal.
When false 1.0
will serialize as 1
When true 1.0
will serialize as 1.0
Default: false
pub fn with_extensions(self, extensions: Extensions) -> Self
[src]
Configures extensions
Default: Extensions::empty()
Trait Implementations
impl Clone for PrettyConfig
[src]
fn clone(&self) -> PrettyConfig
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for PrettyConfig
[src]
impl Default for PrettyConfig
[src]
impl<'de> Deserialize<'de> for PrettyConfig
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for PrettyConfig
[src]
Auto Trait Implementations
impl RefUnwindSafe for PrettyConfig
impl Send for PrettyConfig
impl Sync for PrettyConfig
impl Unpin for PrettyConfig
impl UnwindSafe for PrettyConfig
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,