Struct ncprogbar

Source
#[repr(C)]
pub struct ncprogbar { /* private fields */ }

Implementations§

Source§

impl ncprogbar

§NcProgBar Methods

Source

pub fn new<'a>(plane: &mut NcPlane) -> &'a mut Self

New NcProgBar.

Takes ownership of the plane, which will be destroyed by destroy(). The progress bar is initially at 0%.

Source

pub fn with_options<'a>( plane: &mut NcPlane, options: &NcProgBarOptions, ) -> &'a mut Self

New NcProgBar. Expects an NcProgBarOptions struct.

C style function: ncprogbar_create().

Source

pub fn destroy(&mut self)

Destroy the progress bar and its underlying ncplane.

C style function: ncprogbar_destroy().

Source

pub fn plane(&mut self) -> &mut NcPlane

Return a reference to the ncprogbar’s underlying ncplane.

C style function: ncprogbar_plane().

Source

pub fn progress(&self) -> f64

Get the progress bar’s completion, an f64 on [0, 1].

C style function: ncprogbar_progress().

Source

pub fn set_progress(&mut self, progress: f64) -> NcResult<()>

Sets the progress bar’s completion, an 0 <= f64 <= 1.

Returns NCRESULT_ERR if progress is < 0 || > 1.

C style function: ncprogbar_set_progress().

Trait Implementations§

Source§

impl Debug for ncprogbar

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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.