pub enum ClockSpeed {
SecondsPerTick(f64),
TicksPerSecond(f64),
TicksPerMinute(f64),
}
Expand description
The rate that a clock ticks at.
Variants§
SecondsPerTick(f64)
The clock ticks every x seconds.
TicksPerSecond(f64)
The clock ticks x times per second.
TicksPerMinute(f64)
The clock ticks x times per minute.
Implementations§
Source§impl ClockSpeed
impl ClockSpeed
Sourcepub fn as_seconds_per_tick(&self) -> f64
pub fn as_seconds_per_tick(&self) -> f64
Returns the ClockSpeed
as a number of seconds between each tick.
Sourcepub fn as_ticks_per_second(&self) -> f64
pub fn as_ticks_per_second(&self) -> f64
Returns the ClockSpeed
as a number of ticks per second.
Sourcepub fn as_ticks_per_minute(&self) -> f64
pub fn as_ticks_per_minute(&self) -> f64
Returns the ClockSpeed
as a number of ticks per minute.
Trait Implementations§
Source§impl Clone for ClockSpeed
impl Clone for ClockSpeed
Source§fn clone(&self) -> ClockSpeed
fn clone(&self) -> ClockSpeed
Returns a copy 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 ClockSpeed
impl Debug for ClockSpeed
Source§impl<'de> Deserialize<'de> for ClockSpeed
impl<'de> Deserialize<'de> for ClockSpeed
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<ClockSpeed> for Value<ClockSpeed>
impl From<ClockSpeed> for Value<ClockSpeed>
Source§fn from(clock_speed: ClockSpeed) -> Self
fn from(clock_speed: ClockSpeed) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ClockSpeed
impl PartialEq for ClockSpeed
Source§impl Serialize for ClockSpeed
impl Serialize for ClockSpeed
Source§impl Tweenable for ClockSpeed
impl Tweenable for ClockSpeed
Source§fn interpolate(a: Self, b: Self, amount: f64) -> Self
fn interpolate(a: Self, b: Self, amount: f64) -> Self
impl Copy for ClockSpeed
impl StructuralPartialEq for ClockSpeed
Auto Trait Implementations§
impl Freeze for ClockSpeed
impl RefUnwindSafe for ClockSpeed
impl Send for ClockSpeed
impl Sync for ClockSpeed
impl Unpin for ClockSpeed
impl UnwindSafe for ClockSpeed
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)