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: boolAlign entries vertically.
Entries that have table headers, comments, or blank lines between them are not aligned.
align_comments: boolAlign consecutive comments after entries and items vertically.
This applies to comments that are after entries or array items.
align_single_comments: boolIf align_comments is true, apply the alignment in cases where
there’s only one comment.
array_trailing_comma: boolPut trailing commas for multiline arrays.
array_auto_expand: boolAutomatically expand arrays to multiple lines once they
exceed the configured column_width.
inline_table_expand: boolExpand values (e.g.) inside inline tables where possible.
array_auto_collapse: boolAutomatically collapse arrays if they fit in one line.
The array won’t be collapsed if it contains a comment.
compact_arrays: boolOmit whitespace padding inside single-line arrays.
compact_inline_tables: boolOmit whitespace padding inside inline tables.
compact_entries: boolOmit whitespace around =.
column_width: usizeTarget maximum column width after which arrays are expanded into new lines.
This is best-effort and might not be accurate.
indent_tables: boolIndent subtables if they come in order.
indent_entries: boolIndent entries under tables.
indent_string: StringIndentation to use, should be tabs or spaces but technically could be anything.
trailing_newline: boolAdd trailing newline to the source.
reorder_keys: boolAlphabetically reorder keys that are not separated by blank lines.
reorder_arrays: boolAlphabetically reorder array values that are not separated by blank lines.
allowed_blank_lines: usizeThe maximum amount of consecutive blank lines allowed.
crlf: boolUse 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 schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreimpl Eq for Options
impl StructuralPartialEq for Options
Auto Trait Implementations§
impl Freeze for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
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
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<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>
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>
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