Report

Struct Report 

Source
pub struct Report { /* private fields */ }
Expand description

A command-line report.

§Display

severity[code]: message
entries

Implementations§

Source§

impl Report

Properties

Source

pub fn properties(properties: Vec<(String, String)>) -> Vec<ColoredString>

Generates the properties entry.

§Display
    first:  value
    second: another value
    third:  third value
Source

pub fn add_properties(&mut self, properties: Vec<(String, String)>)

Adds the properties entry.

See Report::properties.

Source

pub fn with_properties(self, properties: Vec<(String, String)>) -> Self

Adds the properties entry.

See Report::properties.

Source§

impl Report

Construction

Source

pub fn new(code: Code) -> Self

Creates a new command-line report.

Source§

impl Report

Entries

Source

pub fn add_entry<E>(&mut self, entry: E)
where E: Into<Vec<ColoredString>>,

Adds the entry.

Source

pub fn with_entry<E>(self, entry: E) -> Self
where E: Into<Vec<ColoredString>>,

Adds the entry.

Source§

impl Report

Token Info

Source

pub fn token_info( file_name: &str, line: usize, position: usize, line_text: &str, token_len: usize, severity: Severity, message: &str, ) -> Vec<ColoredString>

Generates the token info entry.

§Note

The line is the 1-indexed line number. The position is the 0-indexed line position of the first byte within the line_text. The token_len is the number of chars or slots on a monospaced display.

§Display
 --> the/file/name.ext
  |
8 | the line text
  |     ^^^^ the message
  |
Source

pub fn add_token_info( &mut self, file_name: &str, line: usize, position: usize, line_text: &str, token_len: usize, severity: Severity, message: &str, )

Adds the token info entry.

See Report::token_info.

Source

pub fn with_token_info( self, file_name: &str, line: usize, position: usize, line_text: &str, token_len: usize, severity: Severity, message: &str, ) -> Self

Adds the token info entry.

See Report::token_info.

Trait Implementations§

Source§

impl Clone for Report

Source§

fn clone(&self) -> Report

Returns a duplicate 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 Debug for Report

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for Report

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Report

§

impl RefUnwindSafe for Report

§

impl Send for Report

§

impl Sync for Report

§

impl Unpin for Report

§

impl UnwindSafe for Report

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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 T
where T: Clone,

Source§

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 T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

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

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.