pub struct FancyPrinterBuilder { /* private fields */ }
Expand description
Builder for the FancyPrinter
struct
§Example
use fancy_print::{Animation, FancyPrinterBuilder};
use std::time::Duration;
let builder = FancyPrinterBuilder::new()
.animation(Animation::CharacterCycling)
.time_delay(Duration::from_millis(2))
.multi_line(false)
.ignore_newlines(false)
.build();
Implementations§
Source§impl FancyPrinterBuilder
impl FancyPrinterBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Returns a new FancyPrinterBuilder
struct with the defaults shown in the example
Sourcepub fn time_delay(self, time_delay: Duration) -> Self
pub fn time_delay(self, time_delay: Duration) -> Self
The duration of time between frames of the animation. Defaults to 2ms
Sourcepub fn multi_line(self, one_line: bool) -> Self
pub fn multi_line(self, one_line: bool) -> Self
Whether the FancyPrinter
should print new frames on new lines. Defaults to false
Sourcepub fn animation(self, animation: Animation) -> Self
pub fn animation(self, animation: Animation) -> Self
The type of animation the FancyPrinter
will use. Defaults to CharacterCycling
Sourcepub fn ignore_newlines(self, ignore_newlines: bool) -> Self
pub fn ignore_newlines(self, ignore_newlines: bool) -> Self
Whether the FancyPrinter
should ignore newline characters. Defaults to false
Sourcepub fn build(self) -> FancyPrinter
pub fn build(self) -> FancyPrinter
Builds a FancyPrinter
struct with the builders options
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FancyPrinterBuilder
impl RefUnwindSafe for FancyPrinterBuilder
impl Send for FancyPrinterBuilder
impl Sync for FancyPrinterBuilder
impl Unpin for FancyPrinterBuilder
impl UnwindSafe for FancyPrinterBuilder
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