pub struct Options {Show 19 fields
pub align_entries: bool,
pub align_comments: bool,
pub align_single_comments: bool,
pub array_trailing_comma: bool,
pub array_auto_expand: bool,
pub inline_table_expand: bool,
pub array_auto_collapse: bool,
pub compact_arrays: bool,
pub compact_inline_tables: bool,
pub compact_entries: bool,
pub column_width: usize,
pub indent_tables: bool,
pub indent_entries: bool,
pub indent_string: String,
pub trailing_newline: bool,
pub reorder_keys: bool,
pub reorder_arrays: bool,
pub allowed_blank_lines: usize,
pub crlf: bool,
}
Expand description
All the formatting options.
Fields§
§align_entries: bool
Align entries vertically.
Entries that have table headers, comments, or blank lines between them are not aligned.
align_comments: bool
Align consecutive comments after entries and items vertically.
This applies to comments that are after entries or array items.
align_single_comments: bool
If align_comments
is true, apply the alignment in cases where
there’s only one comment.
array_trailing_comma: bool
Put trailing commas for multiline arrays.
array_auto_expand: bool
Automatically expand arrays to multiple lines if they’re too long.
inline_table_expand: bool
Expand values (e.g.) inside inline tables where possible.
array_auto_collapse: bool
Automatically collapse arrays if they fit in one line.
The array won’t be collapsed if it contains a comment.
compact_arrays: bool
Omit whitespace padding inside single-line arrays.
compact_inline_tables: bool
Omit whitespace padding inside inline tables.
compact_entries: bool
Omit whitespace around =
.
column_width: usize
Target maximum column width after which arrays are expanded into new lines.
This is best-effort and might not be accurate.
indent_tables: bool
Indent subtables if they come in order.
indent_entries: bool
Indent entries under tables.
indent_string: String
Indentation to use, should be tabs or spaces but technically could be anything.
trailing_newline: bool
Add trailing newline to the source.
reorder_keys: bool
Alphabetically reorder keys that are not separated by blank lines.
reorder_arrays: bool
Alphabetically reorder array values that are not separated by blank lines.
allowed_blank_lines: usize
The maximum amount of consecutive blank lines allowed.
crlf: bool
Use CRLF line endings
Implementations§
source§impl Options
impl Options
pub fn update(&mut self, incomplete: OptionsIncomplete)
pub fn update_camel(&mut self, incomplete: OptionsIncompleteCamel)
pub fn update_from_str<S: AsRef<str>, I: Iterator<Item = (S, S)>>( &mut self, values: I ) -> Result<(), OptionParseError>
Trait Implementations§
source§impl<'de> Deserialize<'de> for Options
impl<'de> Deserialize<'de> for Options
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>,
source§impl JsonSchema for Options
impl JsonSchema for Options
source§fn schema_name() -> String
fn schema_name() -> String
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read more