[][src]Struct coral::Message

pub struct Message {
    pub message: String,
    pub code: Option<Code>,
    pub level: Level,
    pub spans: Option<Vec<Span>>,
    pub children: Option<Vec<Message>>,
    pub rendered: Option<String>,
}

A message output by cargo

Fields

message: Stringcode: Option<Code>level: Levelspans: Option<Vec<Span>>children: Option<Vec<Message>>rendered: Option<String>

Methods

impl Message[src]

pub fn is_warning(&self) -> bool[src]

Check if the level is a warning

pub fn is_error(&self) -> bool[src]

Check if the level is an error

pub fn is_note(&self) -> bool[src]

Check if the level is a note

pub fn is_help(&self) -> bool[src]

Check if the level is a help

pub fn report_headers(color: bool) -> String[src]

Get a string containing the column headers for reports

pub fn report(&self, color: bool, terminal_width: usize) -> Option<String>[src]

Get the message as a compact report

pub fn replacement_span(&self) -> Option<&Span>[src]

Find a Span that contains a suggested replacement

pub fn unroll(&self) -> impl Iterator<Item = &Message>[src]

Get an iterator over this message and it's children

Trait Implementations

impl Clone for Message[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialEq<Message> for Message[src]

impl Eq for Message[src]

impl Debug for Message[src]

impl Serialize for Message[src]

impl<'de> Deserialize<'de> for Message[src]

Auto Trait Implementations

impl Unpin for Message

impl Sync for Message

impl Send for Message

impl UnwindSafe for Message

impl RefUnwindSafe for Message

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]