pub struct FormatOptions {
pub indent_width: usize,
pub insert_spaces: bool,
pub max_inline_tag_width: usize,
pub attribute_sort: AttributeSort,
pub attribute_layout: AttributeLayout,
pub attributes_per_line: usize,
pub space_before_self_close: bool,
pub quote_style: QuoteStyle,
pub wrapped_attribute_indent: WrappedAttributeIndent,
pub text_content: TextContentMode,
pub blank_lines: BlankLines,
pub ignore_prefixes: Vec<String>,
}Expand description
Formatter configuration for SVG pretty-printing.
§Examples
let options = svg_format::FormatOptions::default();
assert_eq!(options.indent_width, 2);Fields§
§indent_width: usizeNumber of spaces per indentation level when insert_spaces is true.
insert_spaces: boolWhether indentation should use spaces (true) or tabs (false).
max_inline_tag_width: usizeMaximum inline tag width before switching to multi-line attributes.
attribute_sort: AttributeSortAttribute ordering mode.
attribute_layout: AttributeLayoutAttribute wrapping mode.
attributes_per_line: usizeMaximum number of attributes emitted per wrapped line.
space_before_self_close: boolEmit a space before /> in self-closing tags.
quote_style: QuoteStylePreferred quote style for attribute values.
wrapped_attribute_indent: WrappedAttributeIndentIndentation style for wrapped attributes.
text_content: TextContentModeHow text-node whitespace is handled.
blank_lines: BlankLinesHow blank lines between sibling elements are handled.
ignore_prefixes: Vec<String>Comment prefixes that trigger ignore directives.
For each prefix p, the formatter recognizes:
<!-- p-ignore -->— skip formatting the next sibling<!-- p-ignore-file -->— skip the entire file (detected anywhere)<!-- p-ignore-start -->/<!-- p-ignore-end -->— skip a range
Defaults to ["svg-format"].
Trait Implementations§
Source§impl Clone for FormatOptions
impl Clone for FormatOptions
Source§fn clone(&self) -> FormatOptions
fn clone(&self) -> FormatOptions
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 FormatOptions
impl Debug for FormatOptions
Source§impl Default for FormatOptions
impl Default for FormatOptions
impl Eq for FormatOptions
Source§impl PartialEq for FormatOptions
impl PartialEq for FormatOptions
impl StructuralPartialEq for FormatOptions
Auto Trait Implementations§
impl Freeze for FormatOptions
impl RefUnwindSafe for FormatOptions
impl Send for FormatOptions
impl Sync for FormatOptions
impl Unpin for FormatOptions
impl UnsafeUnpin for FormatOptions
impl UnwindSafe for FormatOptions
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