pub struct FancyPrinter { /* private fields */ }
Expand description
Struct to print text to the stdout using various animations
§Example
The example below builds a FancyPrinter
that uses the CharacterCycling
animation with a
delay of 2ms between frames, with frames being printed on the same line and respects newline
characters. It then prints “Hello, world!”.
use fancy_print::{FancyPrinter, Animation};
use std::time::Duration;
let printer = FancyPrinter::builder()
.animation(Animation::CharacterCycling)
.time_delay(Duration::from_millis(2))
.multi_line(false)
.ignore_newlines(false)
.build();
printer.print("Hello, world!");
The options used in the above example are the defaults for the FancyPrinterBuilder
struct
which is returned when the builder()
function is called.
let printer = FancyPrinter::builder()
.animation(Animation::CharacterCycling)
.time_delay(Duration::from_millis(2))
.multi_line(false)
.ignore_newlines(false)
.build();
let default_printer = FancyPrinter::builder().build();
assert_eq!(printer, default_printer);
Implementations§
Source§impl FancyPrinter
impl FancyPrinter
Trait Implementations§
Source§impl Debug for FancyPrinter
impl Debug for FancyPrinter
Source§impl Default for FancyPrinter
impl Default for FancyPrinter
Source§impl PartialEq for FancyPrinter
impl PartialEq for FancyPrinter
impl Eq for FancyPrinter
impl StructuralPartialEq for FancyPrinter
Auto Trait Implementations§
impl Freeze for FancyPrinter
impl RefUnwindSafe for FancyPrinter
impl Send for FancyPrinter
impl Sync for FancyPrinter
impl Unpin for FancyPrinter
impl UnwindSafe for FancyPrinter
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