Struct playdate_controls::peripherals::Crank
source · 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> 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, 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.