Struct banner::Banner[][src]

pub struct Banner<'a> {
    pub width: u8,
    pub auto_widen: bool,
    // some fields omitted
}

Fields

width: u8auto_widen: bool

Implementations

impl<'a> Banner<'a>[src]

pub fn new(style: &'a Style) -> Banner<'a>[src]

Creates a new banner with default values.

pub fn add_header<'b>(&'b mut self, text: &'a str, level: HeaderLevel)[src]

Adds a header to the banner.

Arguments

  • self - The banner to add the line of text to.
  • text - The text content of the header.
  • level - The header level.

pub fn add_text<'b>(&'b mut self, text: &'a str)[src]

Adds a line of text to the banner.

Arguments

  • self - The banner to add the line of text to.
  • text - The text to add.

pub fn add_key_value<'b>(&'b mut self, key: &'a str, value: &'a str)[src]

Adds a line showing a key value pair to the banner.

Arguments

  • self - The banner to add the line to.
  • key - The key name.
  • value - The value as text.

pub fn assemble(self: &Banner<'a>) -> String[src]

Assembles the banner.

Arguments

  • self - The banner to assemble.

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Banner<'a>[src]

impl<'a> !Send for Banner<'a>[src]

impl<'a> !Sync for Banner<'a>[src]

impl<'a> Unpin for Banner<'a>[src]

impl<'a> !UnwindSafe for Banner<'a>[src]

Blanket Implementations

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

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

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

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

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.