Skip to main content

stepped_value

Function stepped_value 

Source
pub fn stepped_value(
    current: i64,
    step: i64,
    min: Option<i64>,
    max: Option<i64>,
) -> Option<i64>
Expand description

Returns the value a stepper button would write, or None when the stepper is inactive.

A stepper is inactive when the step would carry the value past min or max; an unbounded direction never blocks a step. The returned value is clamped into the bounds, so a step that lands exactly on a bound is allowed while one that overshoots it is refused.

§Arguments

  • i64 - The current value of the field.
  • Option<i64> - The inclusive lower bound, or None for no bound.

§Returns

  • Option<i64> - The clamped value the stepper writes, or None when the stepper must stay inert.