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
impl BitAnd<HatState, HatState> for HatState
fn bitand(&self, other: &HatState) -> HatState
Returns the intersection between the two sets of flags.