Skip to main content

Crate rustfmt_nightly

Crate rustfmt_nightly 

Source

Re-exportsΒ§

pub(crate) use crate::comment::LineClasses; πŸ”’
pub(crate) use crate::emitter::Emitter; πŸ”’
pub(crate) use crate::formatting::FormatErrorMap; πŸ”’
pub(crate) use crate::formatting::FormattingError; πŸ”’
pub(crate) use crate::formatting::ReportedErrors; πŸ”’
pub(crate) use crate::formatting::SourceFile; πŸ”’
pub(crate) use crate::modules::ModuleResolutionError; πŸ”’
pub(crate) use crate::parse::parser::DirectoryOwnership; πŸ”’
pub(crate) use crate::shape::Indent; πŸ”’
pub(crate) use crate::utils::indent_next_line; πŸ”’
pub use crate::config::CliOptions;
pub use crate::config::Color;
pub use crate::config::Config;
pub use crate::config::Edition;
pub use crate::config::EmitMode;
pub use crate::config::FileLines;
pub use crate::config::FileName;
pub use crate::config::NewlineStyle;
pub use crate::config::Range;
pub use crate::config::StyleEdition;
pub use crate::config::Verbosity;
pub use crate::config::Version;
pub use crate::config::load_config;
pub use crate::format_report_formatter::FormatReportFormatter;
pub use crate::format_report_formatter::FormatReportFormatterBuilder;
pub use crate::rustfmt_diff::ModifiedChunk;
pub use crate::rustfmt_diff::ModifiedLines;
pub(crate) use std::cell::RefCell; πŸ”’
pub(crate) use std::cmp::min; πŸ”’
pub(crate) use std::collections::HashMap; πŸ”’
pub(crate) use std::fmt; πŸ”’
pub(crate) use io; πŸ”’
pub(crate) use Write; πŸ”’
pub(crate) use std::mem; πŸ”’
pub(crate) use std::panic; πŸ”’
pub(crate) use std::panic; πŸ”’
pub(crate) use std::path::PathBuf; πŸ”’
pub(crate) use std::rc::Rc; πŸ”’
pub(crate) use rustc_ast::ast; πŸ”’
pub(crate) use rustc_span::symbol; πŸ”’
pub(crate) use thiserror::Error; πŸ”’

ModulesΒ§

attr πŸ”’
Format attributes and meta items.
chains πŸ”’
Formatting of chained expressions, i.e., expressions that are chained by dots: struct and enum field access, method calls, and try shorthand (?).
closures πŸ”’
comment πŸ”’
config πŸ”’
coverage πŸ”’
emitter πŸ”’
expr πŸ”’
format_report_formatter πŸ”’
formatting πŸ”’
header πŸ”’
headers are sets of consecutive keywords and tokens, such as pub const unsafe fn foo and pub(crate) unsafe trait Bar.
ignore_path πŸ”’
imports πŸ”’
items πŸ”’
lists πŸ”’
Format list-like expressions and items.
macros πŸ”’
matches πŸ”’
Format match expression.
missed_spans πŸ”’
modules πŸ”’
overflow πŸ”’
Rewrite a list some items with overflow.
pairs πŸ”’
parse πŸ”’
patterns πŸ”’
range πŸ”’
release_channel πŸ”’
reorder πŸ”’
Reorder items.
rewrite πŸ”’
rustfmt_diff πŸ”’
shape πŸ”’
skip πŸ”’
Module that contains skip related stuffs.
sort πŸ”’
source_file πŸ”’
source_map πŸ”’
This module contains utilities that work with the SourceMap from libsyntax/syntex_syntax. This includes extension traits and methods for looking up spans and line ranges for AST nodes.
spanned πŸ”’
stmt πŸ”’
string πŸ”’
types πŸ”’
utils πŸ”’
vertical πŸ”’
visitor πŸ”’

MacrosΒ§

config_option_with_style_edition_default
Defines unit structs to implement StyleEditionDefault for.
is_nightly_channel
Checks if we’re in a nightly build.
static_regex πŸ”’
style_edition_default
macro to help implement StyleEditionDefault for config options

StructsΒ§

FormatReport
Reports on any issues that occurred during a run of Rustfmt.
FormattedSnippet πŸ”’
Result of formatting a snippet of code along with ranges of lines that didn’t get formatted, i.e., that got returned as they were originally.
Session
A session is a run of rustfmt across a single or multiple inputs.

EnumsΒ§

ErrorKind
The various errors that can occur during formatting. Note that not all of these can currently be propagated to clients.
Input

FunctionsΒ§

create_emitter πŸ”’
format_code_block πŸ”’
Format the given code block. Mainly targeted for code block in comment. The code block may be incomplete (i.e., parser may be unable to parse it). To avoid panic in parser, we wrap the code block with a dummy function. The returned code block does not end with newline.
format_snippet πŸ”’
Format the given snippet. The snippet is expected to be complete code. When we cannot parse the given snippet, this function returns None.