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§
impl Copy for Config
impl Eq for Config
Source§impl JsonSchema for Config
impl JsonSchema for Config
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.