Crate rustfmt_nightly[−][src]

Modules

The Rust abstract syntax tree module.

Format attributes and meta items.

Formatting of chained expressions, i.e., expressions that are chained by dots: struct and enum field access, method calls, and try shorthand (?).

Format list-like expressions and items.

Format match expression.

Rewrite a list some items with overflow.

Reorder items.

Module that contains skip related stuffs.

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.

An “interner” is a data structure that associates values with usize tags and allows bidirectional lookup; i.e., given a value, one can easily find the type, and vice versa.

Utilities for formatting and printing Strings.

Traits, helpers, and type definitions for core I/O functionality.

Basic functions for dealing with memory.

Panic support in the standard library.

This module defines a thin abstract layer on top of the rustc’s parser and syntax libraries.

Macros

Checks if we’re in a nightly build.

Panics the current thread.

Structs

A set of lines in files.

Reports on any issues that occurred during a run of Rustfmt.

Formats the warnings/errors in a FormatReport.

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.

A hash map implemented with quadratic probing and SIMD lookup.

A single span of changed lines, with 0 or more removed lines and a vector of 0 or more inserted lines.

Set of changed sections of a file.

An owned, mutable path (akin to String).

A range that is inclusive of both ends.

A single-threaded reference-counting pointer. ‘Rc’ stands for ‘Reference Counted’.

A mutable memory location with dynamically checked borrow rules

A session is a run of rustfmt across a single or multiple inputs.

Enums

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

Defines the name of an input - either a file or stdin.

Traits

Maps client-supplied options to Rustfmt’s internals, mostly overriding values in a config with values from the command line.

A trait for objects which are byte-oriented sinks.

Functions

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 the given snippet. The snippet is expected to be complete code. When we cannot parse the given snippet, this function returns None.

Loads a config by checking the client-supplied options and if appropriate, the file system (including searching the file system for overrides).

Derive Macros