#[repr(C)]pub struct ncprogbar { /* private fields */ }
Implementations§
Source§impl ncprogbar
§NcProgBar
Methods
impl ncprogbar
§NcProgBar
Methods
Sourcepub fn new<'a>(plane: &mut NcPlane) -> &'a mut Self
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%.
Sourcepub fn with_options<'a>(
plane: &mut NcPlane,
options: &NcProgBarOptions,
) -> &'a mut Self
pub fn with_options<'a>( plane: &mut NcPlane, options: &NcProgBarOptions, ) -> &'a mut Self
New NcProgBar. Expects an NcProgBarOptions struct.
C style function: ncprogbar_create().
Sourcepub fn destroy(&mut self)
pub fn destroy(&mut self)
Destroy the progress bar and its underlying ncplane.
C style function: ncprogbar_destroy().
Sourcepub fn plane(&mut self) -> &mut NcPlane
pub fn plane(&mut self) -> &mut NcPlane
Return a reference to the ncprogbar’s underlying ncplane.
C style function: ncprogbar_plane().
Sourcepub fn progress(&self) -> f64
pub fn progress(&self) -> f64
Get the progress bar’s completion, an f64 on [0, 1].
C style function: ncprogbar_progress().
Sourcepub fn set_progress(&mut self, progress: f64) -> NcResult<()>
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§
Auto Trait Implementations§
impl Freeze for ncprogbar
impl RefUnwindSafe for ncprogbar
impl Send for ncprogbar
impl Sync for ncprogbar
impl Unpin for ncprogbar
impl UnwindSafe for ncprogbar
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