Struct libnotcurses_sys::c_api::ncprogbar
source · pub struct ncprogbar { /* private fields */ }Implementations§
source§impl ncprogbar
impl ncprogbar
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().