pub struct X360Notification {
pub large_motor: u8,
pub small_motor: u8,
pub led_number: u8,
}Expand description
A notification received from the bus for an Xbox 360 target.
This contains feedback from the system or a game, such as rumble commands
or the player index assigned to the controller. You can receive these by
calling TargetHandle::<Xbox360>::register_notification.
§Examples
let notifications = x360.register_notification().unwrap();
// In a real application, you might check for notifications on a separate thread.
if let Ok(Ok(notification)) = notifications.try_recv() {
println!(
"Received notification: Player LED = {}, Large Motor = {}",
notification.led_number,
notification.large_motor
);
}Fields§
§large_motor: u8Rumble strength for the large motor (0-255).
small_motor: u8Rumble strength for the small motor (0-255).
led_number: u8The player number (0-3) assigned to the controller, indicated by the LED. This is the most reliable way to determine the controller’s player index.
Trait Implementations§
Source§impl Clone for X360Notification
impl Clone for X360Notification
Source§fn clone(&self) -> X360Notification
fn clone(&self) -> X360Notification
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for X360Notification
impl Debug for X360Notification
Source§impl PartialEq for X360Notification
impl PartialEq for X360Notification
impl Copy for X360Notification
impl Eq for X360Notification
impl StructuralPartialEq for X360Notification
Auto Trait Implementations§
impl Freeze for X360Notification
impl RefUnwindSafe for X360Notification
impl Send for X360Notification
impl Sync for X360Notification
impl Unpin for X360Notification
impl UnwindSafe for X360Notification
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