pub struct FormatConfigBuilder<'a>(/* private fields */);Expand description
A FormatConfig builder.
Note that setters can be repeated.
Implementations§
Source§impl<'a> FormatConfigBuilder<'a>
impl<'a> FormatConfigBuilder<'a>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new FormatConfig builder with default configuration.
Sourcepub const fn maybe_indent_level(self, indent_level: Option<usize>) -> Self
pub const fn maybe_indent_level(self, indent_level: Option<usize>) -> Self
How deeply to indent the overall node or document,
in repetitions of indent.
Defaults to 0 iff not specified.
Sourcepub const fn indent_level(self, indent_level: usize) -> Self
pub const fn indent_level(self, indent_level: usize) -> Self
How deeply to indent the overall node or document,
in repetitions of indent.
Defaults to 0 iff not specified.
Sourcepub const fn maybe_indent<'b, 'c>(
self,
indent: Option<&'b str>,
) -> FormatConfigBuilder<'c>where
'a: 'b,
'b: 'c,
pub const fn maybe_indent<'b, 'c>(
self,
indent: Option<&'b str>,
) -> FormatConfigBuilder<'c>where
'a: 'b,
'b: 'c,
The indentation to use at each level. Defaults to four spaces iff not specified.
Sourcepub const fn indent(self, indent: &str) -> FormatConfigBuilder<'_>
pub const fn indent(self, indent: &str) -> FormatConfigBuilder<'_>
The indentation to use at each level. Defaults to four spaces if not specified.
Sourcepub const fn maybe_no_comments(self, no_comments: Option<bool>) -> Self
pub const fn maybe_no_comments(self, no_comments: Option<bool>) -> Self
Whether to remove comments.
Defaults to false iff not specified.
Sourcepub const fn no_comments(self, no_comments: bool) -> Self
pub const fn no_comments(self, no_comments: bool) -> Self
Whether to remove comments.
Defaults to false iff not specified.
Sourcepub const fn build(self) -> FormatConfig<'a>
pub const fn build(self) -> FormatConfig<'a>
Builds the FormatConfig.
Trait Implementations§
Source§impl<'a> Debug for FormatConfigBuilder<'a>
impl<'a> Debug for FormatConfigBuilder<'a>
Source§impl<'a> Default for FormatConfigBuilder<'a>
impl<'a> Default for FormatConfigBuilder<'a>
Source§fn default() -> FormatConfigBuilder<'a>
fn default() -> FormatConfigBuilder<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> Freeze for FormatConfigBuilder<'a>
impl<'a> RefUnwindSafe for FormatConfigBuilder<'a>
impl<'a> Send for FormatConfigBuilder<'a>
impl<'a> Sync for FormatConfigBuilder<'a>
impl<'a> Unpin for FormatConfigBuilder<'a>
impl<'a> UnwindSafe for FormatConfigBuilder<'a>
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
Mutably borrows from an owned value. Read more