pub struct Config<K, P, V>{ /* private fields */ }
Expand description
The configuration for the formatters. Most of the options are for rustfmt
only (they are ignored
by PrettyPlease, but PostProcess options are used by both formatters).
Implementations§
Source§impl<'a, 'b> Config<&'a str, &'b str, &'a str>
impl<'a, 'b> Config<&'a str, &'b str, &'a str>
Sourcepub fn new_str() -> Self
pub fn new_str() -> Self
Creates a new blank configuration with &str
for all type params
(if you wish to use different types, use new instead)
Sourcepub fn from_hash_map_str(options: HashMap<&'a str, &'a str>) -> Self
pub fn from_hash_map_str(options: HashMap<&'a str, &'a str>) -> Self
Creates a new configuration from the given HashMap of options using &str
for all type params
(if you wish to use different types, use from_hash_map instead)
Source§impl<K, P, V> Config<K, P, V>
impl<K, P, V> Config<K, P, V>
Sourcepub fn from_hash_map(options: HashMap<K, V>) -> Self
pub fn from_hash_map(options: HashMap<K, V>) -> Self
Creates a new configuration from the given HashMap of options with no type assumptions
Sourcepub fn rust_fmt_path(self, path: P) -> Self
pub fn rust_fmt_path(self, path: P) -> Self
Set the path to the rustfmt
binary to use (RustFmt
only, ignored by PrettyPlease
).
This takes precedence over the RUSTFMT
environment variable, if specified
Sourcepub fn edition(self, edition: Edition) -> Self
pub fn edition(self, edition: Edition) -> Self
Set the Rust edition of the source input (RustFmt
only, ignored by PrettyPlease
)
Sourcepub fn post_proc(self, post_proc: PostProcess) -> Self
pub fn post_proc(self, post_proc: PostProcess) -> Self
Set the post processing option after formatting (used by both RustFmt
and PrettyPlease
)