[][src]Struct termprogress::spinner::Spin

pub struct Spin { /* fields omitted */ }

A single character spinner with optional title that can be told to spin whenever it wants. It implements Spinner trait, and is the default spinner.

The spinner takes up a line, and renders it's spinner on the end of its title. Calling the Spinner::bump() function will cause the character sequence to advance.

Usage

To use the spinner you can provide it a Wheel (see [wheel] module), or it implements the Default trait, creating a traditional looking spinner (|/-\)

let mut spin = Spin::default(); //Default new spinner without a title.

How it looks

It renders in the terminal like: This is a spinner /

Implementations

impl Spin[src]

pub fn with_title(title: &str, whl: Wheel) -> Self[src]

Create a new spinner with title and wheel.

To give it the default wheel, you can pass whl Default::default() to use the default one.

pub fn new(whl: Wheel) -> Self[src]

Create a new blank spinner with a wheel

Example

 Spin::new(Default::default()); // Create a spinner with the default wheel ('|/-\')

pub fn complete(self)[src]

Consume the spinner and complete it. Removes the spin character.

pub fn complete_with(self, msg: &str)[src]

Consume the spinner and complete it with a message. Removes the spin character and then prints the message.

Trait Implementations

impl Default for Spin[src]

impl Display for Spin[src]

impl Spinner for Spin[src]

Auto Trait Implementations

impl RefUnwindSafe for Spin

impl Send for Spin

impl Sync for Spin

impl Unpin for Spin

impl UnwindSafe for Spin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.