Struct billboard::Billboard

source ·
pub struct Billboard {
    pub config: Config,
}
Expand description

Billboard is a customizable data structure that will pretty print content separated by newlines (\n).

Fields

config: Config

Display configuration of the Billboard. This field dictates how a Billboard will be displayed in the terminal.

Implementations

Create a Billboard with default configuration.

Example
use billboard::Billboard;

let billboard = Billboard::default();

Creates a new Billboard from a pre-made Config.

Example
use billboard::{Billboard, Config};

let config = Config::default();
let billboard = Billboard::new(config);

Get a configuration builder to customize the appearance of a Billboard.

Example
use billboard::Billboard;

let billboard = Billboard::builder().padding(3).margin(1).build();

Prints your Billboarded content to stdout If your content is long, separate it with line breaks (\n).

If the user’s terminal is too small, or something goes wrong with displaying your content in a box, this function will print the content passed to it with no modifications.

Example
use billboard::Billboard;

Billboard::default().print("Hello, World!\nNew lines can be created with the newline separator :).");

Prints your Billboarded content to stderr If your content is long, separate it with line breaks (\n).

If the user’s terminal is too small, or something goes wrong with displaying your content in a box, this function will print the content passed to it with no modifications.

Example
use billboard::Billboard;

Billboard::default().eprint("Hello, World!\nNew lines can be created with the newline separator :).");

Get your content in a Billboard as a String.

Example
use billboard::Billboard;

let result = Billboard::default().enclose("Hello, World!");
println!("{}", result);

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.