codespan_reporting::term

Struct Chars

Source
pub struct Chars {
Show 16 fields pub snippet_start: String, pub source_border_left: char, pub source_border_left_break: char, pub note_bullet: char, pub single_primary_caret: char, pub single_secondary_caret: char, pub multi_primary_caret_start: char, pub multi_primary_caret_end: char, pub multi_secondary_caret_start: char, pub multi_secondary_caret_end: char, pub multi_top_left: char, pub multi_top: char, pub multi_bottom_left: char, pub multi_bottom: char, pub multi_left: char, pub pointer_left: char,
}
Expand description

Characters to use when rendering the diagnostic.

By using Chars::ascii() you can switch to an ASCII-only format suitable for rendering on terminals that do not support box drawing characters.

Fields§

§snippet_start: String

The characters to use for the top-left border of the snippet. Defaults to: "┌─" or "-->" with Chars::ascii().

§source_border_left: char

The character to use for the left border of the source. Defaults to: '│' or '|' with Chars::ascii().

§source_border_left_break: char

The character to use for the left border break of the source. Defaults to: '·' or '.' with Chars::ascii().

§note_bullet: char

The character to use for the note bullet. Defaults to: '='.

§single_primary_caret: char

The character to use for marking a single-line primary label. Defaults to: '^'.

§single_secondary_caret: char

The character to use for marking a single-line secondary label. Defaults to: '-'.

§multi_primary_caret_start: char

The character to use for marking the start of a multi-line primary label. Defaults to: '^'.

§multi_primary_caret_end: char

The character to use for marking the end of a multi-line primary label. Defaults to: '^'.

§multi_secondary_caret_start: char

The character to use for marking the start of a multi-line secondary label. Defaults to: '\''.

§multi_secondary_caret_end: char

The character to use for marking the end of a multi-line secondary label. Defaults to: '\''.

§multi_top_left: char

The character to use for the top-left corner of a multi-line label. Defaults to: '╭' or '/' with Chars::ascii().

§multi_top: char

The character to use for the top of a multi-line label. Defaults to: '─' or '-' with Chars::ascii().

§multi_bottom_left: char

The character to use for the bottom-left corner of a multi-line label. Defaults to: '╰' or '\' with Chars::ascii().

§multi_bottom: char

The character to use when marking the bottom of a multi-line label. Defaults to: '─' or '-' with Chars::ascii().

§multi_left: char

The character to use for the left of a multi-line label. Defaults to: '│' or '|' with Chars::ascii().

§pointer_left: char

The character to use for the left of a pointer underneath a caret. Defaults to: '│' or '|' with Chars::ascii().

Implementations§

Source§

impl Chars

Source

pub fn box_drawing() -> Chars

A character set that uses Unicode box drawing characters.

Source

pub fn ascii() -> Chars

A character set that only uses ASCII characters.

This is useful if your terminal’s font does not support box drawing characters well and results in output that looks similar to rustc’s diagnostic output.

Trait Implementations§

Source§

impl Clone for Chars

Source§

fn clone(&self) -> Chars

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 Debug for Chars

Source§

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

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

impl Default for Chars

Source§

fn default() -> Chars

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Chars

§

impl RefUnwindSafe for Chars

§

impl Send for Chars

§

impl Sync for Chars

§

impl Unpin for Chars

§

impl UnwindSafe for Chars

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, dst: *mut u8)

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