#[repr(C)]pub struct Gamepad {
reflector_: Reflector,
gamepad_id: u32,
id: String,
index: Cell<i32>,
connected: Cell<bool>,
timestamp: Cell<f64>,
mapping_type: String,
axes: Heap<*mut JSObject>,
buttons: Dom<GamepadButtonList>,
pose: Option<Dom<GamepadPose>>,
hand: GamepadHand,
}
Fields§
§reflector_: Reflector
§gamepad_id: u32
§id: String
§index: Cell<i32>
§connected: Cell<bool>
§timestamp: Cell<f64>
§mapping_type: String
§axes: Heap<*mut JSObject>
§pose: Option<Dom<GamepadPose>>
§hand: GamepadHand
Implementations§
source§impl Gamepad
impl Gamepad
fn __assert_parent_type(&self)
source§impl Gamepad
impl Gamepad
fn new_inherited(
gamepad_id: u32,
id: String,
index: i32,
connected: bool,
timestamp: f64,
mapping_type: String,
buttons: &GamepadButtonList,
pose: Option<&GamepadPose>,
hand: GamepadHand
) -> Gamepad
source§impl Gamepad
impl Gamepad
pub fn gamepad_id(&self) -> u32
pub fn update_connected(&self, connected: bool)
pub fn update_index(&self, index: i32)
pub fn notify_event(&self, event_type: GamepadEventType)
Trait Implementations§
source§impl DomObjectWrap for Gamepad
impl DomObjectWrap for Gamepad
source§const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::GamepadBinding::GamepadBinding::Wrap as for<'a> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::boxed::Box<dom::gamepad::Gamepad>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::gamepad::Gamepad>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::GamepadBinding::GamepadBinding::Wrap as for<'a> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::boxed::Box<dom::gamepad::Gamepad>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::gamepad::Gamepad>>}
Function pointer to the general wrap function type
source§impl GamepadMethods for Gamepad
impl GamepadMethods for Gamepad
fn Id(&self) -> DOMString
fn Index(&self) -> i32
fn Connected(&self) -> bool
fn Timestamp(&self) -> Finite<f64>
fn Mapping(&self) -> DOMString
fn Axes(&self, _cx: JSContext) -> NonNull<JSObject>
fn Buttons(&self) -> Root<Dom<GamepadButtonList>>
fn Hand(&self) -> GamepadHand
fn GetPose(&self) -> Option<Root<Dom<GamepadPose>>>
source§impl IDLInterface for Gamepad
impl IDLInterface for Gamepad
source§impl MallocSizeOf for Gamepad
impl MallocSizeOf for Gamepad
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
source§impl MutDomObject for Gamepad
impl MutDomObject for Gamepad
source§unsafe fn init_reflector(&self, obj: *mut JSObject)
unsafe fn init_reflector(&self, obj: *mut JSObject)
Initializes the Reflector
source§impl PartialEq<Gamepad> for Gamepad
impl PartialEq<Gamepad> for Gamepad
source§impl ToJSValConvertible for Gamepad
impl ToJSValConvertible for Gamepad
Auto Trait Implementations§
impl !RefUnwindSafe for Gamepad
impl !Send for Gamepad
impl !Sync for Gamepad
impl Unpin for Gamepad
impl !UnwindSafe for Gamepad
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> MaybeBoxed<Box<T, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
source§fn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert