Struct conciliator::Tag

source ·
pub struct Tag<'s>(pub Color, pub &'s str);
Expand description

Wraps a str to be Inlined as a colored [ tag ]

Simply calls Paint::tag when Inlined, appending the str in square brackets, with a trailing space. The color of the brackets is determined by Palette::tag and the entire segment is in bold.

let con = conciliator::init();
use conciliator::{Conciliator, Tag, style::Color};
con.line(Tag(Color::Alpha, "×")).push("A new tag!");
[ × ] A new tag!

(Obviously the formatting & colors aren’t reproduced here.)

Tuple Fields§

§0: Color§1: &'s str

Trait Implementations§

source§

impl<'s> Inline for Tag<'s>

source§

fn inline(&self, buffer: &mut Buffer)

Write self into the buffer with colors

Auto Trait Implementations§

§

impl<'s> Freeze for Tag<'s>

§

impl<'s> RefUnwindSafe for Tag<'s>

§

impl<'s> Send for Tag<'s>

§

impl<'s> Sync for Tag<'s>

§

impl<'s> Unpin for Tag<'s>

§

impl<'s> UnwindSafe for Tag<'s>

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> InitialContent for T
where T: Inline + ?Sized,

source§

fn init_buffer(&self, buf: &mut Buffer)

Initialize the buffer
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, U> TryFrom<U> for T
where 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 T
where 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.