pub trait FetchUserInput {
// Required methods
fn read_pressed(&mut self, input: impl Buttonlike) -> bool;
fn read_button_value(&mut self, input: impl Buttonlike) -> f32;
fn read_axis_value(&mut self, input: impl Axislike) -> f32;
fn read_dual_axis_values(&mut self, input: impl DualAxislike) -> Vec2;
}Expand description
A trait used to quickly fetch the value of a given UserInput.
This can be useful for testing purposes.
Required Methods§
Sourcefn read_pressed(&mut self, input: impl Buttonlike) -> bool
fn read_pressed(&mut self, input: impl Buttonlike) -> bool
Returns true if the given Buttonlike input is currently pressed.
Returns the value of the given Buttonlike input.
Sourcefn read_axis_value(&mut self, input: impl Axislike) -> f32
fn read_axis_value(&mut self, input: impl Axislike) -> f32
Returns the value of the given Axislike input.
Sourcefn read_dual_axis_values(&mut self, input: impl DualAxislike) -> Vec2
fn read_dual_axis_values(&mut self, input: impl DualAxislike) -> Vec2
Returns the value of the given DualAxislike input.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".