Struct rebind::ButtonTuple [] [src]

pub struct ButtonTuple(pub Option<Button>, pub Option<Button>, pub Option<Button>);

A three-element tuple of Option<Button>. For simplicity, a maximum number of 3 buttons can be bound to each action, and this is exposed through the InputRebind struct.

Methods

impl ButtonTuple
[src]

fn new() -> Self

Creates a new tuple with no buttons in it (equivalent to Default::default()).

fn contains(&self, button: Button) -> bool

Check if the button is in the tuple.

fn insert_inplace(&mut self, button: Button) -> bool

Insert a button into the tuple if there is room, searching from left to right. If the button is inserted, returns true. Otherwise, if the button is not inserted, this function returns false.

fn max_buttons(&self) -> usize

Get the maximum number of buttons which this tuple can contain.

fn num_buttons_set(&self) -> usize

Returns the number of buttons in the ButtonTuple which are not None.

fn iter(&self) -> ButtonTupleIter

Returns an iterator over this tuple.

Trait Implementations

impl PartialEq for ButtonTuple
[src]

fn eq(&self, __arg_0: &ButtonTuple) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &ButtonTuple) -> bool

This method tests for !=.

impl Hash for ButtonTuple
[src]

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

Feeds this value into the state given, updating the hasher as necessary.

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0

Feeds a slice of this type into the state provided.

impl Eq for ButtonTuple
[src]

impl Default for ButtonTuple
[src]

fn default() -> ButtonTuple

Returns the "default value" for a type. Read more

impl Debug for ButtonTuple
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Copy for ButtonTuple
[src]

impl Clone for ButtonTuple
[src]

fn clone(&self) -> ButtonTuple

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl IntoIterator for ButtonTuple
[src]

type Item = Option<Button>

The type of the elements being iterated over.

type IntoIter = ButtonTupleIter

Which kind of iterator are we turning this into?

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more