pub struct Session<'b, T: Write> {
    pub config: Config,
    pub out: Option<&'b mut T>,
    pub(crate) errors: ReportedErrors,
    pub(crate) source_file: Vec<(FileName, String)>,
    pub(crate) emitter: Box<dyn Emitter + 'b>,
}
Expand description

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

Fields

config: Configout: Option<&'b mut T>errors: ReportedErrorssource_file: Vec<(FileName, String)>emitter: Box<dyn Emitter + 'b>

Implementations

The main entry point for Rustfmt. Formats the given input according to the given config. out is only necessary if required by the configuration.

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

Layout

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 824 bytes