[−][src]Struct billboard::Billboard
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.
Methods
impl Billboard
[src]
pub fn default() -> Billboard
[src]
Create a Billboard
with deafult configuration.
Example
use billboard::Billboard; let billboard = Billboard::default();
pub fn new(config: Config) -> Billboard
[src]
Creates a new Billboard
from a pre-made Config
.
Example
use billboard::{Billboard, Config}; let config = Config::default(); let billboard = Billboard::new(config);
pub fn builder() -> Config
[src]
Get a configuration builder to customize the appearance of a Billboard
.
Example
use billboard::Billboard; let billboard = Billboard::builder().padding(3).margin(1).build();
pub fn display(&self, content: &str)
[src]
Prints your Billboard
ed 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.
If you would like to handle specific error cases, it is recommended to use
.as_str()
directly.
Example
use billboard::Billboard; Billboard::default().display("Hello, World!\nNew lines can be created with the newline separator :).");
pub fn as_str(&self, content: &str) -> String
[src]
Get your content in a Billboard
as a String
.
Example
use billboard::Billboard; let result = Billboard::default().as_str("Hello, World!")?; println!("{}", result);
Trait Implementations
impl Clone for Billboard
[src]
impl Debug for Billboard
[src]
impl PartialEq<Billboard> for Billboard
[src]
impl StructuralPartialEq for Billboard
[src]
Auto Trait Implementations
impl RefUnwindSafe for Billboard
impl Send for Billboard
impl Sync for Billboard
impl Unpin for Billboard
impl UnwindSafe for Billboard
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,