ConfigType in rustfmt_nightly::config::config_type - Rust
Description: Trait for types that can be used in `Config`.

Skip to main content

## ConfigType

# Trait ConfigType

Source

    pub(crate) trait ConfigType: Sized {
        // Required method
        fn doc_hint() -> String;

        // Provided method
        fn stable_variant(&self) -> bool { ... }
    }

Expand description

Trait for types that can be used in `Config`.

## Required Methods§

Source

#### fn doc_hint() -> String

Returns hint text for use in `Config::print_docs()`. For enum types, this is a pipe-separated list of variants; for other types it returns `<type>`.

## Provided Methods§

Source

#### fn stable_variant(&self) -> bool

Return `true` if the variant (i.e. value of this type) is stable.

By default, return true for all values. Enums annotated with `#[config_type]` are automatically implemented, based on the `#[unstable_variant]` annotation.

## Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

## Implementations on Foreign Types§

Source§

### impl ConfigType for String

Source§

#### fn doc_hint() -> String

Source§

### impl ConfigType for bool

Source§

#### fn doc_hint() -> String

Source§

### impl ConfigType for isize

Source§

#### fn doc_hint() -> String

Source§

### impl ConfigType for usize

Source§

#### fn doc_hint() -> String

## Implementors§

Source§

### impl ConfigType for BraceStyle

Source§

### impl ConfigType for Color

Source§

### impl ConfigType for ControlBraceStyle

Source§

### impl ConfigType for Density

Source§

### impl ConfigType for Edition

Source§

### impl ConfigType for EmitMode

Source§

### impl ConfigType for FileLines

Source§

### impl ConfigType for FloatLiteralTrailingZero

Source§

### impl ConfigType for GroupImportsTactic

Source§

### impl ConfigType for Heuristics

Source§

### impl ConfigType for HexLiteralCase

Source§

### impl ConfigType for IgnoreList

Source§

### impl ConfigType for ImportGranularity

Source§

### impl ConfigType for IndentStyle

Source§

### impl ConfigType for ListTactic

Source§

### impl ConfigType for MacroSelectors

Source§

### impl ConfigType for MatchArmLeadingPipe

Source§

### impl ConfigType for NewlineStyle

Source§

### impl ConfigType for ReportTactic

Source§

### impl ConfigType for SeparatorPlace

Source§

### impl ConfigType for SeparatorTactic

Source§

### impl ConfigType for StyleEdition

Source§

### impl ConfigType for TypeDensity

Source§

### impl ConfigType for Verbosity

Source§

### impl ConfigType for Version

Source§

### impl ConfigType for WidthHeuristics