fancy_print

Struct FancyPrinterBuilder

Source
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

Source

pub fn new() -> Self

Returns a new FancyPrinterBuilder struct with the defaults shown in the example

Source

pub fn time_delay(self, time_delay: Duration) -> Self

The duration of time between frames of the animation. Defaults to 2ms

Source

pub fn multi_line(self, one_line: bool) -> Self

Whether the FancyPrinter should print new frames on new lines. Defaults to false

Source

pub fn animation(self, animation: Animation) -> Self

The type of animation the FancyPrinter will use. Defaults to CharacterCycling

Source

pub fn ignore_newlines(self, ignore_newlines: bool) -> Self

Whether the FancyPrinter should ignore newline characters. Defaults to false

Source

pub fn build(self) -> FancyPrinter

Builds a FancyPrinter struct with the builders options

Trait Implementations§

Source§

impl Default for FancyPrinterBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.