[−][src]Struct rustfmt_lib::Config
Fields
license_template: Option<Regex>
Methods
impl Config
[src]
pub fn version_meets_requirement(&self) -> bool
[src]
pub fn from_toml_path(file_path: &Path) -> Result<Config, Error>
[src]
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.
pub fn from_resolved_toml_path(
dir: &Path
) -> Result<(Config, Option<PathBuf>), Error>
[src]
dir: &Path
) -> Result<(Config, Option<PathBuf>), Error>
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.
pub fn from_toml(toml: &str, dir: &Path) -> Result<Config, String>
[src]
impl Config
[src]
pub fn max_width(&self) -> usize
[src]
pub fn hard_tabs(&self) -> bool
[src]
pub fn tab_spaces(&self) -> usize
[src]
pub fn newline_style(&self) -> NewlineStyle
[src]
pub fn use_small_heuristics(&self) -> Heuristics
[src]
pub fn indent_style(&self) -> IndentStyle
[src]
pub fn wrap_comments(&self) -> bool
[src]
pub fn format_code_in_doc_comments(&self) -> bool
[src]
pub fn comment_width(&self) -> usize
[src]
pub fn normalize_comments(&self) -> bool
[src]
pub fn normalize_doc_attributes(&self) -> bool
[src]
pub fn license_template_path(&self) -> String
[src]
pub fn format_strings(&self) -> bool
[src]
pub fn format_macro_matchers(&self) -> bool
[src]
pub fn format_macro_bodies(&self) -> bool
[src]
pub fn empty_item_single_line(&self) -> bool
[src]
pub fn struct_lit_single_line(&self) -> bool
[src]
pub fn fn_single_line(&self) -> bool
[src]
pub fn where_single_line(&self) -> bool
[src]
pub fn imports_indent(&self) -> IndentStyle
[src]
pub fn imports_layout(&self) -> ListTactic
[src]
pub fn merge_imports(&self) -> bool
[src]
pub fn reorder_imports(&self) -> bool
[src]
pub fn reorder_modules(&self) -> bool
[src]
pub fn reorder_impl_items(&self) -> bool
[src]
pub fn type_punctuation_density(&self) -> TypeDensity
[src]
pub fn space_before_colon(&self) -> bool
[src]
pub fn space_after_colon(&self) -> bool
[src]
pub fn spaces_around_ranges(&self) -> bool
[src]
pub fn binop_separator(&self) -> SeparatorPlace
[src]
pub fn remove_nested_parens(&self) -> bool
[src]
pub fn combine_control_expr(&self) -> bool
[src]
pub fn overflow_delimited_expr(&self) -> bool
[src]
pub fn struct_field_align_threshold(&self) -> usize
[src]
pub fn enum_discrim_align_threshold(&self) -> usize
[src]
pub fn match_arm_blocks(&self) -> bool
[src]
pub fn force_multiline_blocks(&self) -> bool
[src]
pub fn fn_args_layout(&self) -> Density
[src]
pub fn brace_style(&self) -> BraceStyle
[src]
pub fn control_brace_style(&self) -> ControlBraceStyle
[src]
pub fn trailing_semicolon(&self) -> bool
[src]
pub fn trailing_comma(&self) -> SeparatorTactic
[src]
pub fn match_block_trailing_comma(&self) -> bool
[src]
pub fn blank_lines_upper_bound(&self) -> usize
[src]
pub fn blank_lines_lower_bound(&self) -> usize
[src]
pub fn edition(&self) -> Edition
[src]
pub fn version(&self) -> Version
[src]
pub fn inline_attribute_width(&self) -> usize
[src]
pub fn merge_derives(&self) -> bool
[src]
pub fn use_try_shorthand(&self) -> bool
[src]
pub fn use_field_init_shorthand(&self) -> bool
[src]
pub fn force_explicit_abi(&self) -> bool
[src]
pub fn condense_wildcard_suffixes(&self) -> bool
[src]
pub fn color(&self) -> Color
[src]
pub fn required_version(&self) -> String
[src]
pub fn unstable_features(&self) -> bool
[src]
pub fn disable_all_formatting(&self) -> bool
[src]
pub fn skip_children(&self) -> bool
[src]
pub fn hide_parse_errors(&self) -> bool
[src]
pub fn error_on_line_overflow(&self) -> bool
[src]
pub fn error_on_unformatted(&self) -> bool
[src]
pub fn report_todo(&self) -> ReportTactic
[src]
pub fn report_fixme(&self) -> ReportTactic
[src]
pub fn ignore(&self) -> IgnoreList
[src]
pub fn verbose(&self) -> Verbosity
[src]
pub fn file_lines(&self) -> FileLines
[src]
pub fn width_heuristics(&self) -> WidthHeuristics
[src]
pub fn emit_mode(&self) -> EmitMode
[src]
pub fn print_misformatted_file_names(&self) -> bool
[src]
pub fn recursive(&self) -> bool
[src]
pub fn set(&mut self) -> ConfigSetter
[src]
pub fn was_set(&self) -> ConfigWasSet
[src]
pub fn hash_set() -> HashSet<&'static str, RandomState>
[src]
Returns a hash set initialized with every user-facing config option name.
pub fn is_valid_name(name: &str) -> bool
[src]
pub fn is_valid_key_val(key: &str, val: &str) -> bool
[src]
pub fn used_options(&self) -> PartialConfig
[src]
pub fn all_options(&self) -> PartialConfig
[src]
pub fn override_value(&mut self, key: &str, val: &str)
[src]
[src]
pub fn print_docs(out: &mut dyn Write, include_unstable: bool)
[src]
pub fn is_default(&self, key: &str) -> bool
[src]
Returns true
if the config key was explicitly set and is the default value.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Config
impl Send for Config
impl !Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<E> SpecializationError for E
[src]
default fn not_found<S, T>(
trait_name: &'static str,
method_name: &'static str
) -> E where
T: ?Sized,
[src]
trait_name: &'static str,
method_name: &'static str
) -> E where
T: ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,