pub struct Config {
pub indent: Indent,
pub max_line_length: MaxLineLength,
pub sort_imports: bool,
pub sort_inputs: bool,
pub trailing_commas: bool,
pub newline_style: NewlineStyle,
}Expand description
Configuration for formatting.
Fields§
§indent: IndentThe indentation configuration.
max_line_length: MaxLineLengthThe maximum line length.
sort_imports: boolWhether to sort import statements alphabetically.
sort_inputs: boolWhether to sort input sections.
trailing_commas: boolWhether to add trailing commas to multiline lists.
newline_style: NewlineStyleThe newline style.
Implementations§
Source§impl Config
impl Config
Sourcepub fn newline_style(self, newline_style: NewlineStyle) -> Self
pub fn newline_style(self, newline_style: NewlineStyle) -> Self
Set the newline style.
Sourcepub fn max_line_length(self, max_line_length: MaxLineLength) -> Self
pub fn max_line_length(self, max_line_length: MaxLineLength) -> Self
Overwrite the maximum line length configuration.
Sourcepub fn sort_imports(self, sort_imports: bool) -> Self
pub fn sort_imports(self, sort_imports: bool) -> Self
Set whether import sorting is enabled.
Sourcepub fn sort_inputs(self, sort_inputs: bool) -> Self
pub fn sort_inputs(self, sort_inputs: bool) -> Self
Set whether input sorting is enabled.
Sourcepub fn trailing_commas(self, trailing_commas: bool) -> Self
pub fn trailing_commas(self, trailing_commas: bool) -> Self
Set whether trailing commas are enabled.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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
impl Copy for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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