pub struct Figlet { /* private fields */ }Expand description
A reusable renderer holding a parsed Font and resolved layout
settings.
Cheap to clone; clone the Figlet across threads to render many
banners concurrently with the same font configuration.
use rusty_figlet::{FigletBuilder, Font};
let figlet = FigletBuilder::new()
.font(Font::Standard)
.build()
.expect("build");
let banner = figlet.render("Hi").expect("render");
assert!(banner.height() >= 1);Implementations§
Source§impl Figlet
impl Figlet
Sourcepub fn render(&self, text: &str) -> Result<Banner, FigletError>
pub fn render(&self, text: &str) -> Result<Banner, FigletError>
Render text into a Banner.
The returned banner exposes a lazy line iterator (per FR-053): row
buffers are precomputed once during render(), and Banner::lines
yields one row per next() without copying the whole banner.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Figlet
impl RefUnwindSafe for Figlet
impl Send for Figlet
impl Sync for Figlet
impl Unpin for Figlet
impl UnsafeUnpin for Figlet
impl UnwindSafe for Figlet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more