pub struct SpinnerBuilder { /* private fields */ }
Expand description
A builder for creating a terminal spinner.
Implementations§
Source§impl<'a> SpinnerBuilder
impl<'a> SpinnerBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new builder.
Examples found in repository?
More examples
Additional examples can be found in:
- examples/pipe.rs
- examples/pong.rs
- examples/star.rs
- examples/arrow.rs
- examples/clock.rs
- examples/dots2.rs
- examples/dots3.rs
- examples/dots4.rs
- examples/dots5.rs
- examples/dots6.rs
- examples/dots7.rs
- examples/dots8.rs
- examples/dots9.rs
- examples/earth.rs
- examples/layer.rs
- examples/line2.rs
- examples/noise.rs
- examples/point.rs
- examples/shark.rs
- examples/star2.rs
- examples/arrow2.rs
- examples/arrow3.rs
- examples/bounce.rs
- examples/circle.rs
- examples/dots10.rs
- examples/dots11.rs
- examples/dots12.rs
- examples/hearts.rs
- examples/monkey.rs
- examples/runner.rs
- examples/smiley.rs
- examples/squish.rs
- examples/toggle.rs
- examples/balloon.rs
- examples/grenade.rs
- examples/toggle2.rs
- examples/toggle3.rs
- examples/toggle4.rs
- examples/toggle5.rs
- examples/toggle6.rs
- examples/toggle7.rs
- examples/toggle8.rs
- examples/toggle9.rs
- examples/weather.rs
- examples/balloon2.rs
- examples/material.rs
- examples/toggle10.rs
- examples/toggle11.rs
- examples/toggle12.rs
- examples/toggle13.rs
- examples/triangle.rs
- examples/aesthetic.rs
- examples/beta_wave.rs
- examples/christmas.rs
- examples/dots8_bit.rs
- examples/hamburger.rs
- examples/clear_line.rs
- examples/box_bounce.rs
- examples/box_bounce2.rs
- examples/simple_dots.rs
- examples/bouncing_bar.rs
- examples/bouncing_ball.rs
- examples/circle_halves.rs
- examples/grow_vertical.rs
- examples/square_corners.rs
- examples/circle_quarters.rs
- examples/grow_horizontal.rs
- examples/simple_dots_scrolling.rs
- examples/prefix.rs
Sourcepub fn spinner(self, spinner: &'static SpinnerData<'static>) -> Self
pub fn spinner(self, spinner: &'static SpinnerData<'static>) -> Self
The spinner animation to use.
Examples found in repository?
More examples
Additional examples can be found in:
- examples/pipe.rs
- examples/pong.rs
- examples/star.rs
- examples/arrow.rs
- examples/clock.rs
- examples/dots2.rs
- examples/dots3.rs
- examples/dots4.rs
- examples/dots5.rs
- examples/dots6.rs
- examples/dots7.rs
- examples/dots8.rs
- examples/dots9.rs
- examples/earth.rs
- examples/layer.rs
- examples/line2.rs
- examples/noise.rs
- examples/point.rs
- examples/shark.rs
- examples/star2.rs
- examples/arrow2.rs
- examples/arrow3.rs
- examples/bounce.rs
- examples/circle.rs
- examples/dots10.rs
- examples/dots11.rs
- examples/dots12.rs
- examples/hearts.rs
- examples/monkey.rs
- examples/runner.rs
- examples/smiley.rs
- examples/squish.rs
- examples/toggle.rs
- examples/balloon.rs
- examples/grenade.rs
- examples/toggle2.rs
- examples/toggle3.rs
- examples/toggle4.rs
- examples/toggle5.rs
- examples/toggle6.rs
- examples/toggle7.rs
- examples/toggle8.rs
- examples/toggle9.rs
- examples/weather.rs
- examples/balloon2.rs
- examples/material.rs
- examples/toggle10.rs
- examples/toggle11.rs
- examples/toggle12.rs
- examples/toggle13.rs
- examples/triangle.rs
- examples/aesthetic.rs
- examples/beta_wave.rs
- examples/christmas.rs
- examples/dots8_bit.rs
- examples/hamburger.rs
- examples/clear_line.rs
- examples/box_bounce.rs
- examples/box_bounce2.rs
- examples/simple_dots.rs
- examples/bouncing_bar.rs
- examples/bouncing_ball.rs
- examples/circle_halves.rs
- examples/grow_vertical.rs
- examples/square_corners.rs
- examples/circle_quarters.rs
- examples/grow_horizontal.rs
- examples/simple_dots_scrolling.rs
- examples/prefix.rs
Sourcepub fn text(self, text: impl Into<Cow<'static, str>>) -> Self
pub fn text(self, text: impl Into<Cow<'static, str>>) -> Self
The text to show after the spinner animation.
Examples found in repository?
More examples
Additional examples can be found in:
- examples/pipe.rs
- examples/pong.rs
- examples/star.rs
- examples/arrow.rs
- examples/clock.rs
- examples/dots2.rs
- examples/dots3.rs
- examples/dots4.rs
- examples/dots5.rs
- examples/dots6.rs
- examples/dots7.rs
- examples/dots8.rs
- examples/dots9.rs
- examples/earth.rs
- examples/layer.rs
- examples/line2.rs
- examples/noise.rs
- examples/point.rs
- examples/shark.rs
- examples/star2.rs
- examples/arrow2.rs
- examples/arrow3.rs
- examples/bounce.rs
- examples/circle.rs
- examples/dots10.rs
- examples/dots11.rs
- examples/dots12.rs
- examples/hearts.rs
- examples/monkey.rs
- examples/runner.rs
- examples/smiley.rs
- examples/squish.rs
- examples/toggle.rs
- examples/balloon.rs
- examples/grenade.rs
- examples/toggle2.rs
- examples/toggle3.rs
- examples/toggle4.rs
- examples/toggle5.rs
- examples/toggle6.rs
- examples/toggle7.rs
- examples/toggle8.rs
- examples/toggle9.rs
- examples/weather.rs
- examples/balloon2.rs
- examples/material.rs
- examples/toggle10.rs
- examples/toggle11.rs
- examples/toggle12.rs
- examples/toggle13.rs
- examples/triangle.rs
- examples/aesthetic.rs
- examples/beta_wave.rs
- examples/christmas.rs
- examples/dots8_bit.rs
- examples/hamburger.rs
- examples/clear_line.rs
- examples/box_bounce.rs
- examples/box_bounce2.rs
- examples/simple_dots.rs
- examples/bouncing_bar.rs
- examples/bouncing_ball.rs
- examples/circle_halves.rs
- examples/grow_vertical.rs
- examples/square_corners.rs
- examples/circle_quarters.rs
- examples/grow_horizontal.rs
- examples/simple_dots_scrolling.rs
- examples/prefix.rs
Sourcepub fn prefix(self, prefix: impl Into<Cow<'static, str>>) -> Self
pub fn prefix(self, prefix: impl Into<Cow<'static, str>>) -> Self
The prefix to print before the actual spinning animation.
§Note
The prefix must not include newlines, as the library deletion does not account for those.
Sourcepub fn start(self) -> SpinnerHandle
pub fn start(self) -> SpinnerHandle
Starts the spinner and renders it on a separate thread.
§Returns
A SpinnerHandle
, allowing for further control of the spinner after it gets rendered.
§Panics
If no text and spinner have been set.
Examples found in repository?
More examples
Additional examples can be found in:
- examples/pipe.rs
- examples/pong.rs
- examples/star.rs
- examples/arrow.rs
- examples/clock.rs
- examples/dots2.rs
- examples/dots3.rs
- examples/dots4.rs
- examples/dots5.rs
- examples/dots6.rs
- examples/dots7.rs
- examples/dots8.rs
- examples/dots9.rs
- examples/earth.rs
- examples/layer.rs
- examples/line2.rs
- examples/noise.rs
- examples/point.rs
- examples/shark.rs
- examples/star2.rs
- examples/arrow2.rs
- examples/arrow3.rs
- examples/bounce.rs
- examples/circle.rs
- examples/dots10.rs
- examples/dots11.rs
- examples/dots12.rs
- examples/hearts.rs
- examples/monkey.rs
- examples/runner.rs
- examples/smiley.rs
- examples/squish.rs
- examples/toggle.rs
- examples/balloon.rs
- examples/grenade.rs
- examples/toggle2.rs
- examples/toggle3.rs
- examples/toggle4.rs
- examples/toggle5.rs
- examples/toggle6.rs
- examples/toggle7.rs
- examples/toggle8.rs
- examples/toggle9.rs
- examples/weather.rs
- examples/balloon2.rs
- examples/material.rs
- examples/toggle10.rs
- examples/toggle11.rs
- examples/toggle12.rs
- examples/toggle13.rs
- examples/triangle.rs
- examples/aesthetic.rs
- examples/beta_wave.rs
- examples/christmas.rs
- examples/dots8_bit.rs
- examples/hamburger.rs
- examples/clear_line.rs
- examples/box_bounce.rs
- examples/box_bounce2.rs
- examples/simple_dots.rs
- examples/bouncing_bar.rs
- examples/bouncing_ball.rs
- examples/circle_halves.rs
- examples/grow_vertical.rs
- examples/square_corners.rs
- examples/circle_quarters.rs
- examples/grow_horizontal.rs
- examples/simple_dots_scrolling.rs
- examples/prefix.rs
Trait Implementations§
Source§impl Clone for SpinnerBuilder
impl Clone for SpinnerBuilder
Source§fn clone(&self) -> SpinnerBuilder
fn clone(&self) -> SpinnerBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for SpinnerBuilder
impl Default for SpinnerBuilder
Source§fn default() -> SpinnerBuilder
fn default() -> SpinnerBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SpinnerBuilder
impl RefUnwindSafe for SpinnerBuilder
impl Send for SpinnerBuilder
impl Sync for SpinnerBuilder
impl Unpin for SpinnerBuilder
impl UnwindSafe for SpinnerBuilder
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