Struct rustfmt_nightly::Config [−][src]
pub struct Config {Show 81 fields
pub license_template: Option<Regex>,
max_width: (Cell<bool>, bool, usize, bool),
hard_tabs: (Cell<bool>, bool, bool, bool),
tab_spaces: (Cell<bool>, bool, usize, bool),
newline_style: (Cell<bool>, bool, NewlineStyle, bool),
indent_style: (Cell<bool>, bool, IndentStyle, bool),
use_small_heuristics: (Cell<bool>, bool, Heuristics, bool),
width_heuristics: (Cell<bool>, bool, WidthHeuristics, bool),
fn_call_width: (Cell<bool>, bool, usize, bool),
attr_fn_like_width: (Cell<bool>, bool, usize, bool),
struct_lit_width: (Cell<bool>, bool, usize, bool),
struct_variant_width: (Cell<bool>, bool, usize, bool),
array_width: (Cell<bool>, bool, usize, bool),
chain_width: (Cell<bool>, bool, usize, bool),
single_line_if_else_max_width: (Cell<bool>, bool, usize, bool),
wrap_comments: (Cell<bool>, bool, bool, bool),
format_code_in_doc_comments: (Cell<bool>, bool, bool, bool),
comment_width: (Cell<bool>, bool, usize, bool),
normalize_comments: (Cell<bool>, bool, bool, bool),
normalize_doc_attributes: (Cell<bool>, bool, bool, bool),
license_template_path: (Cell<bool>, bool, String, bool),
format_strings: (Cell<bool>, bool, bool, bool),
format_macro_matchers: (Cell<bool>, bool, bool, bool),
format_macro_bodies: (Cell<bool>, bool, bool, bool),
empty_item_single_line: (Cell<bool>, bool, bool, bool),
struct_lit_single_line: (Cell<bool>, bool, bool, bool),
fn_single_line: (Cell<bool>, bool, bool, bool),
where_single_line: (Cell<bool>, bool, bool, bool),
imports_indent: (Cell<bool>, bool, IndentStyle, bool),
imports_layout: (Cell<bool>, bool, ListTactic, bool),
imports_granularity: (Cell<bool>, bool, ImportGranularity, bool),
group_imports: (Cell<bool>, bool, GroupImportsTactic, bool),
merge_imports: (Cell<bool>, bool, bool, bool),
reorder_imports: (Cell<bool>, bool, bool, bool),
reorder_modules: (Cell<bool>, bool, bool, bool),
reorder_impl_items: (Cell<bool>, bool, bool, bool),
type_punctuation_density: (Cell<bool>, bool, TypeDensity, bool),
space_before_colon: (Cell<bool>, bool, bool, bool),
space_after_colon: (Cell<bool>, bool, bool, bool),
spaces_around_ranges: (Cell<bool>, bool, bool, bool),
binop_separator: (Cell<bool>, bool, SeparatorPlace, bool),
remove_nested_parens: (Cell<bool>, bool, bool, bool),
combine_control_expr: (Cell<bool>, bool, bool, bool),
overflow_delimited_expr: (Cell<bool>, bool, bool, bool),
struct_field_align_threshold: (Cell<bool>, bool, usize, bool),
enum_discrim_align_threshold: (Cell<bool>, bool, usize, bool),
match_arm_blocks: (Cell<bool>, bool, bool, bool),
match_arm_leading_pipes: (Cell<bool>, bool, MatchArmLeadingPipe, bool),
force_multiline_blocks: (Cell<bool>, bool, bool, bool),
fn_args_layout: (Cell<bool>, bool, Density, bool),
brace_style: (Cell<bool>, bool, BraceStyle, bool),
control_brace_style: (Cell<bool>, bool, ControlBraceStyle, bool),
trailing_semicolon: (Cell<bool>, bool, bool, bool),
trailing_comma: (Cell<bool>, bool, SeparatorTactic, bool),
match_block_trailing_comma: (Cell<bool>, bool, bool, bool),
blank_lines_upper_bound: (Cell<bool>, bool, usize, bool),
blank_lines_lower_bound: (Cell<bool>, bool, usize, bool),
edition: (Cell<bool>, bool, Edition, bool),
version: (Cell<bool>, bool, Version, bool),
inline_attribute_width: (Cell<bool>, bool, usize, bool),
merge_derives: (Cell<bool>, bool, bool, bool),
use_try_shorthand: (Cell<bool>, bool, bool, bool),
use_field_init_shorthand: (Cell<bool>, bool, bool, bool),
force_explicit_abi: (Cell<bool>, bool, bool, bool),
condense_wildcard_suffixes: (Cell<bool>, bool, bool, bool),
color: (Cell<bool>, bool, Color, bool),
required_version: (Cell<bool>, bool, String, bool),
unstable_features: (Cell<bool>, bool, bool, bool),
disable_all_formatting: (Cell<bool>, bool, bool, bool),
skip_children: (Cell<bool>, bool, bool, bool),
hide_parse_errors: (Cell<bool>, bool, bool, bool),
error_on_line_overflow: (Cell<bool>, bool, bool, bool),
error_on_unformatted: (Cell<bool>, bool, bool, bool),
report_todo: (Cell<bool>, bool, ReportTactic, bool),
report_fixme: (Cell<bool>, bool, ReportTactic, bool),
ignore: (Cell<bool>, bool, IgnoreList, bool),
verbose: (Cell<bool>, bool, Verbosity, bool),
file_lines: (Cell<bool>, bool, FileLines, bool),
emit_mode: (Cell<bool>, bool, EmitMode, bool),
make_backup: (Cell<bool>, bool, bool, bool),
print_misformatted_file_names: (Cell<bool>, bool, bool, bool),
}
Fields
license_template: Option<Regex>
max_width: (Cell<bool>, bool, usize, bool)
hard_tabs: (Cell<bool>, bool, bool, bool)
tab_spaces: (Cell<bool>, bool, usize, bool)
newline_style: (Cell<bool>, bool, NewlineStyle, bool)
indent_style: (Cell<bool>, bool, IndentStyle, bool)
use_small_heuristics: (Cell<bool>, bool, Heuristics, bool)
width_heuristics: (Cell<bool>, bool, WidthHeuristics, bool)
fn_call_width: (Cell<bool>, bool, usize, bool)
attr_fn_like_width: (Cell<bool>, bool, usize, bool)
struct_lit_width: (Cell<bool>, bool, usize, bool)
struct_variant_width: (Cell<bool>, bool, usize, bool)
array_width: (Cell<bool>, bool, usize, bool)
chain_width: (Cell<bool>, bool, usize, bool)
single_line_if_else_max_width: (Cell<bool>, bool, usize, bool)
wrap_comments: (Cell<bool>, bool, bool, bool)
format_code_in_doc_comments: (Cell<bool>, bool, bool, bool)
comment_width: (Cell<bool>, bool, usize, bool)
normalize_comments: (Cell<bool>, bool, bool, bool)
normalize_doc_attributes: (Cell<bool>, bool, bool, bool)
license_template_path: (Cell<bool>, bool, String, bool)
format_strings: (Cell<bool>, bool, bool, bool)
format_macro_matchers: (Cell<bool>, bool, bool, bool)
format_macro_bodies: (Cell<bool>, bool, bool, bool)
empty_item_single_line: (Cell<bool>, bool, bool, bool)
struct_lit_single_line: (Cell<bool>, bool, bool, bool)
fn_single_line: (Cell<bool>, bool, bool, bool)
where_single_line: (Cell<bool>, bool, bool, bool)
imports_indent: (Cell<bool>, bool, IndentStyle, bool)
imports_layout: (Cell<bool>, bool, ListTactic, bool)
imports_granularity: (Cell<bool>, bool, ImportGranularity, bool)
group_imports: (Cell<bool>, bool, GroupImportsTactic, bool)
merge_imports: (Cell<bool>, bool, bool, bool)
reorder_imports: (Cell<bool>, bool, bool, bool)
reorder_modules: (Cell<bool>, bool, bool, bool)
reorder_impl_items: (Cell<bool>, bool, bool, bool)
type_punctuation_density: (Cell<bool>, bool, TypeDensity, bool)
space_before_colon: (Cell<bool>, bool, bool, bool)
space_after_colon: (Cell<bool>, bool, bool, bool)
spaces_around_ranges: (Cell<bool>, bool, bool, bool)
binop_separator: (Cell<bool>, bool, SeparatorPlace, bool)
remove_nested_parens: (Cell<bool>, bool, bool, bool)
combine_control_expr: (Cell<bool>, bool, bool, bool)
overflow_delimited_expr: (Cell<bool>, bool, bool, bool)
struct_field_align_threshold: (Cell<bool>, bool, usize, bool)
enum_discrim_align_threshold: (Cell<bool>, bool, usize, bool)
match_arm_blocks: (Cell<bool>, bool, bool, bool)
match_arm_leading_pipes: (Cell<bool>, bool, MatchArmLeadingPipe, bool)
force_multiline_blocks: (Cell<bool>, bool, bool, bool)
fn_args_layout: (Cell<bool>, bool, Density, bool)
brace_style: (Cell<bool>, bool, BraceStyle, bool)
control_brace_style: (Cell<bool>, bool, ControlBraceStyle, bool)
trailing_semicolon: (Cell<bool>, bool, bool, bool)
trailing_comma: (Cell<bool>, bool, SeparatorTactic, bool)
match_block_trailing_comma: (Cell<bool>, bool, bool, bool)
blank_lines_upper_bound: (Cell<bool>, bool, usize, bool)
blank_lines_lower_bound: (Cell<bool>, bool, usize, bool)
edition: (Cell<bool>, bool, Edition, bool)
version: (Cell<bool>, bool, Version, bool)
inline_attribute_width: (Cell<bool>, bool, usize, bool)
merge_derives: (Cell<bool>, bool, bool, bool)
use_try_shorthand: (Cell<bool>, bool, bool, bool)
use_field_init_shorthand: (Cell<bool>, bool, bool, bool)
force_explicit_abi: (Cell<bool>, bool, bool, bool)
condense_wildcard_suffixes: (Cell<bool>, bool, bool, bool)
color: (Cell<bool>, bool, Color, bool)
required_version: (Cell<bool>, bool, String, bool)
unstable_features: (Cell<bool>, bool, bool, bool)
disable_all_formatting: (Cell<bool>, bool, bool, bool)
skip_children: (Cell<bool>, bool, bool, bool)
hide_parse_errors: (Cell<bool>, bool, bool, bool)
error_on_line_overflow: (Cell<bool>, bool, bool, bool)
error_on_unformatted: (Cell<bool>, bool, bool, bool)
report_todo: (Cell<bool>, bool, ReportTactic, bool)
report_fixme: (Cell<bool>, bool, ReportTactic, bool)
ignore: (Cell<bool>, bool, IgnoreList, bool)
verbose: (Cell<bool>, bool, Verbosity, bool)
file_lines: (Cell<bool>, bool, FileLines, bool)
emit_mode: (Cell<bool>, bool, EmitMode, bool)
make_backup: (Cell<bool>, bool, bool, bool)
print_misformatted_file_names: (Cell<bool>, bool, bool, bool)
Implementations
Returns true
if the config key was explicitly set and is the default value.
Constructs a Config
from the toml file specified at file_path
.
This method only looks at the provided path, for a method that
searches parents for a rustfmt.toml
see from_resolved_toml_path
.
Returns a Config
if the config could be read and parsed from
the file, otherwise errors.
Resolves the config for input in dir
.
Searches for rustfmt.toml
beginning with dir
, and
recursively checking parents of dir
if no config file is found.
If no config file exists in dir
or in any parent, a
default Config
will be returned (and the returned path will be empty).
Returns the Config
to use, and the path of the project file if there was
one.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Config
impl UnwindSafe for Config
Blanket Implementations
Mutably borrows from an owned value. Read more
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 784 bytes