rustfmt_nightly::config::config_type

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", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ConfigType for bool

Source§

impl ConfigType for isize

Source§

impl ConfigType for usize

Source§

impl ConfigType for String

Implementors§