kyuri

Struct Bar

Source
pub struct Bar { /* private fields */ }
Expand description

A handle for users to control a progress bar created by Manager.

Implementations§

Source§

impl Bar

Source

pub fn inc(&self, n: u64)

Increment the progress bar by n. This makes an unforced draw.

Source

pub fn set_pos(&self, pos: u64)

Set the position of the progress bar. This makes an unforced draw.

Source

pub fn set_len(&self, len: u64)

Set the total length of the progress bar. This makes an unforced draw.

Source

pub fn get_pos(&self) -> u64

Get the position of the progress bar.

When manager is dropped, this would return 0

Source

pub fn get_len(&self) -> u64

Get the total length of the progress bar.

When manager is dropped, this would return 0

Source

pub fn finish(&self)

Set the progress bar to the end, and force a draw.

Source

pub fn finish_and_drop(self)

Set the progress bar to the end, force a draw, and remove the progress bar from the manager.

Source

pub fn set_visible(&self, visible: bool)

Set the visibility of the progress bar. This makes an forced draw when visible actually changes.

Source

pub fn is_visible(&self) -> bool

Get the visibility of the progress bar.

When manager is dropped, this would return false

Source

pub fn set_message(&self, message: &str)

Set the message of the progress bar. This makes an unforced draw.

Source

pub fn set_template(&self, template: &str)

Set the template of the progress bar. This makes an unforced draw.

Source

pub fn alive(&self) -> bool

Return whether the progress bar (the manager) is still alive.

When the manager is dropped, the progress bar would not be able to be interacted with.

Trait Implementations§

Source§

impl Drop for Bar

Source§

fn drop(&mut self)

Drop the progress bar. This removes the progress bar from the manager and forces a draw.

Auto Trait Implementations§

§

impl Freeze for Bar

§

impl RefUnwindSafe for Bar

§

impl Send for Bar

§

impl Sync for Bar

§

impl Unpin for Bar

§

impl UnwindSafe for Bar

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.