Struct libnotcurses_sys::examples::Counter [−][src]
pub struct Counter {
pub starting: isize,
pub current: isize,
pub step: isize,
pub limit: Option<isize>,
}Expand description
A little versatile Counter.
Fields
starting: isizeThe starting value.
current: isizeThe current value.
step: isizeThe amount to increase the current value on each
update, until it reaches its limit.
limit: Option<isize>An optional limit value that, when reached, will prevent further updating the counter.
If set, it must have the same sign as the step. If not set,
the natural limit will be |isize::MAX|.
Implementations
Returns a new Counter.
Note that limit and step must be both positive or negative together.
If a limit value has been set, returns true when the counter has
reached its limit value, and if not, increments its current value.
If there’s no limit value, always returns false while incrementing
the current value.
Returns true if the counter has reached its limit value.
When there’s no limit, it will always return false.
