pub struct Peripherals<Api = Default>(/* private fields */);Expand description
Peripherals
Implementations§
Source§impl Peripherals<Default>
impl Peripherals<Default>
Sourcepub fn Default() -> Self
pub fn Default() -> Self
Creates default Peripherals without type parameter requirement.
Uses ZST api::Default.
Source§impl Peripherals<Cache>
impl Peripherals<Cache>
Sourcepub fn Cached() -> Self
pub fn Cached() -> Self
Creates Peripherals without type parameter requirement.
Uses api::Cache.
Source§impl<Api> Peripherals<Api>where
Api: Copy + Api,
impl<Api> Peripherals<Api>where
Api: Copy + Api,
pub const fn accelerometer(&self) -> Accelerometer<Api>
pub const fn crank(&self) -> Crank<Api>
Source§impl<Api: Api> Peripherals<Api>
impl<Api: Api> Peripherals<Api>
Sourcepub fn enable(&self, value: PDPeripherals)
pub fn enable(&self, value: PDPeripherals)
Enables specified peripheral.
Equivalent to sys::ffi::playdate_sys::setPeripheralsEnabled
Sourcepub fn enable_accelerometer(&self)
pub fn enable_accelerometer(&self)
By default, the accelerometer is disabled to save (a small amount of) power.
To use a peripheral, it must first be enabled via this function.
Accelerometer data is not available until the next update cycle after it’s enabled.
Equivalent to sys::ffi::playdate_sys::setPeripheralsEnabled
Sourcepub fn enable_all(&self)
pub fn enable_all(&self)
Enables all peripherals.
Equivalent to sys::ffi::playdate_sys::setPeripheralsEnabled
Sourcepub fn disable_all(&self)
pub fn disable_all(&self)
Disables all peripherals.
Equivalent to sys::ffi::playdate_sys::setPeripheralsEnabled
Source§impl Peripherals<Default>
impl Peripherals<Default>
pub const None: PDPeripherals = PDPeripherals::kNone
pub const Accelerometer: PDPeripherals = PDPeripherals::kAccelerometer
pub const All: PDPeripherals = PDPeripherals::kAllPeripherals
Trait Implementations§
Source§impl<Api: Clone> Clone for Peripherals<Api>
impl<Api: Clone> Clone for Peripherals<Api>
Source§fn clone(&self) -> Peripherals<Api>
fn clone(&self) -> Peripherals<Api>
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<Api: Debug> Debug for Peripherals<Api>
impl<Api: Debug> Debug for Peripherals<Api>
Source§impl<Api: Default + Api> Default for Peripherals<Api>
impl<Api: Default + Api> Default for Peripherals<Api>
impl<Api: Copy> Copy for Peripherals<Api>
Auto Trait Implementations§
impl<Api> Freeze for Peripherals<Api>where
Api: Freeze,
impl<Api> RefUnwindSafe for Peripherals<Api>where
Api: RefUnwindSafe,
impl<Api> Send for Peripherals<Api>where
Api: Send,
impl<Api> Sync for Peripherals<Api>where
Api: Sync,
impl<Api> Unpin for Peripherals<Api>where
Api: Unpin,
impl<Api> UnwindSafe for Peripherals<Api>where
Api: UnwindSafe,
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
§impl<T> ToOwned for Twhere
T: Clone,
impl<T> ToOwned for Twhere
T: Clone,
§impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.