pub struct FormattingOptions {
pub indent: usize,
pub max_width: usize,
pub trailing_comma: bool,
pub spaced_collections: bool,
pub space_in_collection: bool,
pub spaces_around_operators: bool,
pub type_declaration_formatting: TypeDeclarationFormatting,
pub statement_formatting: StatementFormatting,
pub variant_formatting: VariantFormatting,
pub bracket_style: BracketStyle,
}Fields§
§indent: usizeNumber of spaces to use for indentation.
max_width: usizeMaximum line width before wrapping occurs.
trailing_comma: boolWhether to add trailing commas in collections like lists and maps.
E.g., [1, 2, 3,] instead of [1, 2, 3].
spaced_collections: boolWhether to add spaces inside brackets of collections like lists and maps.
E.g., [ 1,2,3 ] instead of [1,2,3].
space_in_collection: boolWhether to add spaces inside collections like lists and maps.
E.g., [1, 2, 3] instead of [1,2,3].
spaces_around_operators: boolWhether to add spaces around operators.
E.g., 1 + 2 instead of 1+2.
type_declaration_formatting: TypeDeclarationFormattingFormatting style for type declarations. Determines how type annotations are spaced and aligned.
statement_formatting: StatementFormattingWhether to add newlines between statements.
variant_formatting: VariantFormattingFormatting style for type variant suffixes.
bracket_style: BracketStyleBracketing style for expressions.
Implementations§
Trait Implementations§
Source§impl Clone for FormattingOptions
impl Clone for FormattingOptions
Source§fn clone(&self) -> FormattingOptions
fn clone(&self) -> FormattingOptions
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 FormattingOptions
impl Debug for FormattingOptions
Source§impl Default for FormattingOptions
impl Default for FormattingOptions
Source§impl PartialEq for FormattingOptions
impl PartialEq for FormattingOptions
impl Eq for FormattingOptions
impl StructuralPartialEq for FormattingOptions
Auto Trait Implementations§
impl Freeze for FormattingOptions
impl RefUnwindSafe for FormattingOptions
impl Send for FormattingOptions
impl Sync for FormattingOptions
impl Unpin for FormattingOptions
impl UnwindSafe for FormattingOptions
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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