pub struct PrinterConfig {
pub indent_style: IndentStyle,
pub indent_text: Cow<'static, str>,
pub line_ending: LineEnding,
pub max_width: usize,
pub insert_final_newline: bool,
pub trim_trailing_whitespace: bool,
pub indent_size: usize,
}Expand description
Printer configuration
Fields§
§indent_style: IndentStyleIndent style
indent_text: Cow<'static, str>Indent text (cached single-level indent string)
line_ending: LineEndingLine ending
max_width: usizeMaximum line length
insert_final_newline: boolWhether to insert a final newline at the end of the file
trim_trailing_whitespace: boolWhether to trim trailing whitespace
indent_size: usizeIndent size (used for column calculation)
Implementations§
Source§impl PrinterConfig
impl PrinterConfig
Sourcepub fn line_ending_string(&self) -> &'static str
pub fn line_ending_string(&self) -> &'static str
Gets the line ending string
Sourcepub fn with_indent_style(self, style: IndentStyle) -> Self
pub fn with_indent_style(self, style: IndentStyle) -> Self
Sets the indent style
Sourcepub fn with_line_ending(self, ending: LineEnding) -> Self
pub fn with_line_ending(self, ending: LineEnding) -> Self
Sets the line ending
Sourcepub fn with_max_width(self, length: usize) -> Self
pub fn with_max_width(self, length: usize) -> Self
Sets the maximum line length
Trait Implementations§
Source§impl Clone for PrinterConfig
impl Clone for PrinterConfig
Source§fn clone(&self) -> PrinterConfig
fn clone(&self) -> PrinterConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PrinterConfig
impl Debug for PrinterConfig
Auto Trait Implementations§
impl Freeze for PrinterConfig
impl RefUnwindSafe for PrinterConfig
impl Send for PrinterConfig
impl Sync for PrinterConfig
impl Unpin for PrinterConfig
impl UnsafeUnpin for PrinterConfig
impl UnwindSafe for PrinterConfig
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