[][src]Struct amethyst_input::Bindings

pub struct Bindings<AX, AC> where
    AX: Hash + Eq,
    AC: Hash + Eq
{ /* fields omitted */ }

Used for saving and loading input settings.

An action can either be a single button or a combination of them.

Methods

impl<AX, AC> Bindings<AX, AC> where
    AX: Hash + Eq,
    AC: Hash + Eq
[src]

pub fn new() -> Self[src]

Creates a new empty Bindings structure

impl<AX, AC> Bindings<AX, AC> where
    AX: Hash + Eq + Clone,
    AC: Hash + Eq + Clone
[src]

pub fn insert_axis<A: Into<AX>>(&mut self, id: A, axis: Axis) -> Option<Axis>[src]

Assign an axis to an ID value

This will insert a new axis if no entry for this id exists. If one does exist this will replace the axis at that id and return it.

pub fn remove_axis<A: Hash + Eq + ?Sized>(&mut self, id: &A) -> Option<Axis> where
    AX: Borrow<A>, 
[src]

Removes an axis, this will return the removed axis if successful.

pub fn axis<A: Hash + Eq + ?Sized>(&mut self, id: &A) -> Option<&Axis> where
    AX: Borrow<A>, 
[src]

Returns a reference to an axis.

pub fn axes(&self) -> Vec<AX>[src]

Gets a list of all axes

pub fn insert_action_binding<A, B: IntoIterator<Item = Button>>(
    &mut self,
    id: A,
    binding: B
) where
    A: Hash + Eq + Into<AC>,
    AC: Borrow<A>, 
[src]

Add a button or button combination to an action.

This will insert a new binding between this action and the button(s).

pub fn remove_action_binding<T: Hash + Eq + ?Sized>(
    &mut self,
    id: &T,
    binding: SmallVec<[Button; 2]>
) where
    AC: Borrow<T>, 
[src]

Removes an action binding that was assigned previously.

pub fn action_bindings<T: Hash + Eq + ?Sized>(
    &self,
    id: &T
) -> Option<&[SmallVec<[Button; 2]>]> where
    AC: Borrow<T>, 
[src]

Returns an action's bindings.

pub fn actions(&self) -> Vec<AC>[src]

Gets a list of all action bindings

Trait Implementations

impl<AX, AC> Default for Bindings<AX, AC> where
    AX: Hash + Eq,
    AC: Hash + Eq
[src]

impl<AX: Clone, AC: Clone> Clone for Bindings<AX, AC> where
    AX: Hash + Eq,
    AC: Hash + Eq
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<AX, AC> Serialize for Bindings<AX, AC> where
    AX: Hash + Eq,
    AC: Hash + Eq,
    AX: Serialize,
    AC: Serialize
[src]

impl<'de, AX, AC> Deserialize<'de> for Bindings<AX, AC> where
    AX: Hash + Eq,
    AC: Hash + Eq,
    AX: Deserialize<'de>,
    AC: Deserialize<'de>, 
[src]

Auto Trait Implementations

impl<AX, AC> Send for Bindings<AX, AC> where
    AC: Send,
    AX: Send

impl<AX, AC> Sync for Bindings<AX, AC> where
    AC: Sync,
    AX: Sync

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Same for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf for SP where
    SS: SubsetOf<SP>, 

impl<T> Resource for T where
    T: Any + Send + Sync

impl<T> TryDefault for T where
    T: Default

fn unwrap_default() -> Self

Calls try_default and panics on an error case.

impl<T> Any for T where
    T: Any

impl<T> Event for T where
    T: Send + Sync + 'static, 

impl<T> Erased for T

impl<T> Erased for T

impl<T> Config for T where
    T: Deserialize<'a> + Serialize + Default
[src]

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.