pub struct FormatConfig {
pub indent_style: IndentStyle,
pub indent_width: usize,
pub max_line_width: usize,
pub trailing_newline: bool,
pub preserve_comments: bool,
pub sort_imports: bool,
}Expand description
Configuration options for the SEA code formatter.
Fields§
§indent_style: IndentStyleStyle of indentation (spaces or tabs).
indent_width: usizeNumber of spaces per indentation level (ignored if using tabs).
max_line_width: usizeMaximum line width before wrapping (advisory).
trailing_newline: boolWhether to ensure file ends with a newline.
preserve_comments: boolWhether to preserve comments in output.
sort_imports: boolWhether to sort imports alphabetically.
Implementations§
Source§impl FormatConfig
impl FormatConfig
Sourcepub fn with_indent_style(self, style: IndentStyle) -> Self
pub fn with_indent_style(self, style: IndentStyle) -> Self
Set the indent style.
Sourcepub fn with_indent_width(self, width: usize) -> Self
pub fn with_indent_width(self, width: usize) -> Self
Set the indent width (for spaces).
Sourcepub fn indent_string(&self) -> String
pub fn indent_string(&self) -> String
Get the string to use for one level of indentation.
Trait Implementations§
Source§impl Clone for FormatConfig
impl Clone for FormatConfig
Source§fn clone(&self) -> FormatConfig
fn clone(&self) -> FormatConfig
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 FormatConfig
impl Debug for FormatConfig
Source§impl Default for FormatConfig
impl Default for FormatConfig
Source§impl<'de> Deserialize<'de> for FormatConfig
impl<'de> Deserialize<'de> for FormatConfig
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 FormatConfig
impl RefUnwindSafe for FormatConfig
impl Send for FormatConfig
impl Sync for FormatConfig
impl Unpin for FormatConfig
impl UnwindSafe for FormatConfig
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