Skip to Content
VectorLib

ExitCondition

vectorlib::ExitCondition — fields, methods, parameters and return types.


pub struct ExitCondition

Exits when the input has stayed within range for time milliseconds.

View source

Methods

Prop

Type

new

pub const fn new(range: f32, time: i32) -> Self

Create a new exit condition.

  • range — the exit condition will be met when the input is within this range
  • time — the exit condition will be met if the input stays in range for this many milliseconds

Parameters

Prop

Type

Returns

Self

View source

get_exit

pub fn get_exit(&self) -> bool

Whether the exit condition has been met.

Returns

bool

View source

update

pub fn update(&mut self, input: f32) -> bool

Update the exit condition and return whether it has been met.

Parameters

Prop

Type

Returns

bool

View source

reset

pub fn reset(&mut self)

Reset the exit condition timer.

Returns

()

View source