pub trait InputAction: Copy + 'static {
type Binding: Persisted + Display;
// Required methods
fn defaults(&self) -> Vec<Self::Binding>;
fn all() -> Vec<Self>;
fn name(&self) -> &'static str;
fn from_name(name: &str) -> Option<Self>;
}Expand description
Trait every action vocabulary implements, written by
InputButtonAction,
InputAxisAction and
InputAxis2Action.
Required if you want to rebind or read an action generically; the kind traits are what a game implements by hand.
Required Associated Types§
Required Methods§
Sourcefn defaults(&self) -> Vec<Self::Binding>
fn defaults(&self) -> Vec<Self::Binding>
Default controls this action is bound to, before a player changes anything.
Sourcefn all() -> Vec<Self>
fn all() -> Vec<Self>
Every action of this vocabulary, which startup materializes into the table a player rebinds; one this leaves out reads through nothing.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".