pub struct Button { /* private fields */ }
Expand description
A bit field with currently pressed buttons.
The F1 games publish which buttons are currently being pressed by the user. This information is encoded in a bit field, where each bit represents a different button.
Implementations§
Source§impl Button
impl Button
pub const NONE: Button
pub const CROSS_OR_A: Button
pub const TRIANGLE_OR_Y: Button
pub const CIRCLE_OR_B: Button
pub const SQUARE_OR_X: Button
pub const DPAD_LEFT: Button
pub const DPAD_RIGHT: Button
pub const DPAD_UP: Button
pub const DPAD_DOWN: Button
pub const OPTIONS_OR_MENU: Button
pub const L1_OR_LB: Button
pub const R1_OR_RB: Button
pub const L2_OR_LT: Button
pub const R2_OR_RT: Button
pub const LEFT_STICK_CLICK: Button
pub const RIGHT_STICK_CLICK: Button
Sourcepub fn from_bits(bits: u32) -> Option<Button>
pub fn from_bits(bits: u32) -> Option<Button>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
Sourcepub const fn from_bits_truncate(bits: u32) -> Button
pub const fn from_bits_truncate(bits: u32) -> Button
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
Sourcepub const unsafe fn from_bits_unchecked(bits: u32) -> Button
pub const unsafe fn from_bits_unchecked(bits: u32) -> Button
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
Sourcepub const fn intersects(&self, other: Button) -> bool
pub const fn intersects(&self, other: Button) -> bool
Returns true
if there are flags common to both self
and other
.
Trait Implementations§
Source§impl BitAndAssign for Button
impl BitAndAssign for Button
Source§fn bitand_assign(&mut self, other: Button)
fn bitand_assign(&mut self, other: Button)
Disables all flags disabled in the set.
Source§impl BitOrAssign for Button
impl BitOrAssign for Button
Source§fn bitor_assign(&mut self, other: Button)
fn bitor_assign(&mut self, other: Button)
Adds the set of flags.
Source§impl BitXorAssign for Button
impl BitXorAssign for Button
Source§fn bitxor_assign(&mut self, other: Button)
fn bitxor_assign(&mut self, other: Button)
Toggles the set of flags.
Source§impl Extend<Button> for Button
impl Extend<Button> for Button
Source§fn extend<T: IntoIterator<Item = Button>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Button>>(&mut self, iterator: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl FromIterator<Button> for Button
impl FromIterator<Button> for Button
Source§impl Ord for Button
impl Ord for Button
Source§impl PartialOrd for Button
impl PartialOrd for Button
Source§impl SubAssign for Button
impl SubAssign for Button
Source§fn sub_assign(&mut self, other: Button)
fn sub_assign(&mut self, other: Button)
Disables all flags enabled in the set.
impl Copy for Button
impl Eq for Button
impl StructuralPartialEq for Button
Auto Trait Implementations§
impl Freeze for Button
impl RefUnwindSafe for Button
impl Send for Button
impl Sync for Button
impl Unpin for Button
impl UnwindSafe for Button
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more