[−][src]Struct termprogress::spinner::Spin
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]
fn refresh(&self)
[src]
fn blank(&self)
[src]
fn get_title(&self) -> &str
[src]
fn set_title(&mut self, from: &str)
[src]
fn update_dimensions(&mut self, _to: usize)
[src]
fn println(&self, string: &str)
[src]
fn eprintln(&self, string: &str)
[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,