Struct sdl2::joystick::HatState[src]

pub struct HatState {
    // some fields omitted
}

Methods

impl HatState

fn empty() -> HatState

Returns an empty set of flags.

fn all() -> HatState

Returns the set containing all flags.

fn bits(&self) -> u8

Returns the raw value of the flags currently stored.

unsafe fn from_bits(bits: u8) -> HatState

Convert from underlying bit representation. Unsafe because the bits are not guaranteed to represent valid flags.

fn is_empty(&self) -> bool

Returns true if no flags are currently stored.

fn is_all(&self) -> bool

Returns true if all flags are currently set.

fn intersects(&self, other: HatState) -> bool

Returns true if there are flags common to both self and other.

fn contains(&self, other: HatState) -> bool

Returns true all of the flags in other are contained within self.

fn insert(&mut self, other: HatState)

Inserts the specified flags in-place.

fn remove(&mut self, other: HatState)

Removes the specified flags in-place.

Trait Implementations

impl BitOr<HatState, HatState> for HatState

fn bitor(&self, other: &HatState) -> HatState

Returns the union of the two sets of flags.

impl BitAnd<HatState, HatState> for HatState

fn bitand(&self, other: &HatState) -> HatState

Returns the intersection between the two sets of flags.

impl Sub<HatState, HatState> for HatState

fn sub(&self, other: &HatState) -> HatState

Returns the set difference of the two sets of flags.

impl Not<HatState> for HatState

fn not(&self) -> HatState

Returns the complement of this set of flags.

Derived Implementations

impl Clone for HatState

fn clone(&self) -> HatState

impl TotalEq for HatState

impl Eq for HatState

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

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