pub struct StatusLine<D: Display> { /* private fields */ }
Expand description
Wraps arbitrary data and displays it periodically on the screen.
Implementations§
Source§impl<D: Display + Send + Sync + 'static> StatusLine<D>
impl<D: Display + Send + Sync + 'static> StatusLine<D>
Sourcepub fn new(data: D) -> StatusLine<D>
pub fn new(data: D) -> StatusLine<D>
Creates a new StatusLine
with default options and shows it immediately.
Examples found in repository?
examples/progress-bar.rs (line 27)
21fn main() {
22 let progress = Progress {
23 pos: AtomicUsize::new(0),
24 max: 1000000000,
25 };
26
27 let progress_bar = StatusLine::new(progress);
28
29 // StatusLine can be moved to another thread:
30 thread::spawn(move || {
31 for _ in 0..progress_bar.max {
32 progress_bar.pos.fetch_add(1, Ordering::Relaxed);
33 }
34 })
35 .join()
36 .unwrap();
37}
Sourcepub fn with_options(data: D, options: Options) -> StatusLine<D>
pub fn with_options(data: D, options: Options) -> StatusLine<D>
Creates a new StatusLine
with custom options.
Source§impl<D: Display> StatusLine<D>
impl<D: Display> StatusLine<D>
Sourcepub fn refresh(&self)
pub fn refresh(&self)
Forces redrawing the status information immediately, without waiting for the next refresh cycle of the background refresh loop.
Sourcepub fn set_visible(&self, visible: bool)
pub fn set_visible(&self, visible: bool)
Sets the visibility of the status line.
Sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
Returns true if the status line is currently visible.
Trait Implementations§
Source§impl<D: Display> Deref for StatusLine<D>
impl<D: Display> Deref for StatusLine<D>
Auto Trait Implementations§
impl<D> Freeze for StatusLine<D>
impl<D> RefUnwindSafe for StatusLine<D>where
D: RefUnwindSafe,
impl<D> Send for StatusLine<D>
impl<D> Sync for StatusLine<D>
impl<D> Unpin for StatusLine<D>
impl<D> UnwindSafe for StatusLine<D>where
D: RefUnwindSafe,
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