pub struct Crank<Api = Default>(/* private fields */);Expand description
Crank
Implementations§
Source§impl Crank<Default>
impl Crank<Default>
Sourcepub fn Default() -> Self
pub fn Default() -> Self
Creates default Crank without type parameter requirement.
Uses ZST api::Default.
Source§impl Crank<Cache>
impl Crank<Cache>
Sourcepub fn Cached() -> Self
pub fn Cached() -> Self
Creates Crank without type parameter requirement.
Uses api::Cache.
Source§impl<Api: Api> Crank<Api>
impl<Api: Api> Crank<Api>
Sourcepub fn docked(&self) -> bool
pub fn docked(&self) -> bool
Returns boolean indicating whether or not the crank is folded into the unit.
Equivalent to sys::ffi::playdate_sys::isCrankDocked.
Sourcepub fn angle(&self) -> c_float
pub fn angle(&self) -> c_float
Returns the current position of the crank, in the range 0-360. Zero is pointing up, and the value increases as the crank moves clockwise, as viewed from the right side of the device.
Equivalent to sys::ffi::playdate_sys::getCrankAngle.
Sourcepub fn change(&self) -> c_float
pub fn change(&self) -> c_float
Returns the angle change of the crank since the last time this function was called. Negative values are anti-clockwise.
Equivalent to sys::ffi::playdate_sys::getCrankChange.
Sourcepub fn disable_sounds(&self, disable: bool) -> bool
pub fn disable_sounds(&self, disable: bool) -> bool
Returns the previous value for this setting.
Equivalent to sys::ffi::playdate_sys::setCrankSoundsDisabled.
Trait Implementations§
impl<Api: Copy> Copy for Crank<Api>
Auto Trait Implementations§
impl<Api> Freeze for Crank<Api>where
Api: Freeze,
impl<Api> RefUnwindSafe for Crank<Api>where
Api: RefUnwindSafe,
impl<Api> Send for Crank<Api>where
Api: Send,
impl<Api> Sync for Crank<Api>where
Api: Sync,
impl<Api> Unpin for Crank<Api>where
Api: Unpin,
impl<Api> UnwindSafe for Crank<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.