pub struct FormatterSettings {
pub max_width: usize,
pub tab_spaces: usize,
pub indentation_style: IndentationStyle,
pub newline_style: NewlineStyle,
pub attr_value_brace_style: AttributeValueBraceStyle,
pub closing_tag_style: ClosingTagStyle,
pub macro_names: Vec<String>,
pub attr_values: HashMap<String, ExpressionFormatter>,
}
Fields§
§max_width: usize
Maximum width of each line
tab_spaces: usize
Number of spaces per tab
indentation_style: IndentationStyle
Determines indentation style (tabs or spaces)
newline_style: NewlineStyle
Determines line ending (unix or windows)
attr_value_brace_style: AttributeValueBraceStyle
Determines placement of braces around single expression attribute values
closing_tag_style: ClosingTagStyle
Preferred style for closing tags (self-closing or not) when a non-void element has no children
macro_names: Vec<String>
Determines macros to be formatted. Default: leptos::view, view
attr_values: HashMap<String, ExpressionFormatter>
Determines whether to format attribute values with a specific formatter (e.g. tailwind)
Implementations§
Source§impl FormatterSettings
impl FormatterSettings
pub fn to_printer_settings(&self, source: Option<&Rope>) -> PrinterSettings
Trait Implementations§
Source§impl Clone for FormatterSettings
impl Clone for FormatterSettings
Source§fn clone(&self) -> FormatterSettings
fn clone(&self) -> FormatterSettings
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 FormatterSettings
impl Debug for FormatterSettings
Source§impl Default for FormatterSettings
impl Default for FormatterSettings
Source§impl<'de> Deserialize<'de> for FormatterSettingswhere
FormatterSettings: Default,
impl<'de> Deserialize<'de> for FormatterSettingswhere
FormatterSettings: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FormatterSettings
impl RefUnwindSafe for FormatterSettings
impl Send for FormatterSettings
impl Sync for FormatterSettings
impl Unpin for FormatterSettings
impl UnwindSafe for FormatterSettings
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more