pub struct FormatReport {
    pub(crate) internal: Rc<RefCell<(HashMap<FileName, Vec<FormattingError>>, ReportedErrors)>>,
    pub(crate) non_formatted_ranges: Vec<(usize, usize)>,
}
Expand description

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

Can be reported to the user using the Display impl on FormatReportFormatter.

Fields§

§internal: Rc<RefCell<(HashMap<FileName, Vec<FormattingError>>, ReportedErrors)>>§non_formatted_ranges: Vec<(usize, usize)>

Implementations§

source§

impl FormatReport

source

pub(crate) fn new() -> FormatReport

source

pub(crate) fn add_non_formatted_ranges(&mut self, ranges: Vec<(usize, usize)>)

source

pub(crate) fn append(&self, f: FileName, v: Vec<FormattingError>)

source

pub(crate) fn track_errors(&self, new_errors: &[FormattingError])

source

pub(crate) fn add_diff(&mut self)

source

pub(crate) fn add_macro_format_failure(&mut self)

source

pub(crate) fn add_parsing_error(&mut self)

source

pub(crate) fn warning_count(&self) -> usize

source

pub fn has_warnings(&self) -> bool

Whether any warnings or errors are present in the report.

source

pub fn fancy_print( &self, t: Box<dyn Terminal<Output = Stderr>> ) -> Result<(), Error>

👎Deprecated: Use FormatReportFormatter with colors enabled instead

Print the report to a terminal using colours and potentially other fancy output.

Trait Implementations§

source§

impl Clone for FormatReport

source§

fn clone(&self) -> FormatReport

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Display for FormatReport

Deprecated - Use FormatReportFormatter instead

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::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: 32 bytes