pub struct FormatterOptions {
pub end_of_line: Option<EndOfLine>,
pub indent_size: usize,
pub trim_empty_lines: bool,
pub use_tabs: bool,
pub print_width: usize,
pub single_quote: bool,
}Expand description
Configuration for the formatter.
§Examples
use ardent::FormatterOptions;
// Use defaults (tabs, indent size 2, trim empty lines)
let opts = FormatterOptions::default();
// Use 4-space indentation
let opts = FormatterOptions {
use_tabs: false,
indent_size: 4,
..Default::default()
};Fields§
§end_of_line: Option<EndOfLine>Line ending style. When None, the formatter auto-detects from the input.
indent_size: usizeNumber of spaces per indent level (ignored when use_tabs is true).
trim_empty_lines: boolWhether to collapse consecutive blank lines and strip leading/trailing blanks.
use_tabs: boolWhether to indent with tabs (true) or spaces (false).
print_width: usizeMaximum line width before breaking with \ continuations. 0 disables wrapping.
single_quote: boolWhether to prefer single quotes (true) or double quotes (false).
Trait Implementations§
Source§impl Clone for FormatterOptions
impl Clone for FormatterOptions
Source§fn clone(&self) -> FormatterOptions
fn clone(&self) -> FormatterOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 FormatterOptions
impl Debug for FormatterOptions
Auto Trait Implementations§
impl Freeze for FormatterOptions
impl RefUnwindSafe for FormatterOptions
impl Send for FormatterOptions
impl Sync for FormatterOptions
impl Unpin for FormatterOptions
impl UnsafeUnpin for FormatterOptions
impl UnwindSafe for FormatterOptions
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