pub struct Duration { /* private fields */ }Expand description
Difference between two Instant’s. Used by Device::delay.
Implementations§
Source§impl Duration
impl Duration
Sourcepub const fn from_fps(fps: u32) -> Self
pub const fn from_fps(fps: u32) -> Self
Given the desired frames per second, get the duration of a single frame.
pub const fn from_s(s: u32) -> Self
pub const fn from_ms(ms: u32) -> Self
pub const fn from_us(us: u32) -> Self
pub const fn s(&self) -> u32
pub const fn ms(&self) -> u32
pub const fn us(&self) -> u32
pub const fn ns(&self) -> u32
Trait Implementations§
Source§impl AddAssign for Duration
impl AddAssign for Duration
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl PartialOrd for Duration
impl PartialOrd for Duration
Source§impl SubAssign for Duration
impl SubAssign for Duration
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreimpl Copy for Duration
impl StructuralPartialEq for Duration
Auto Trait Implementations§
impl Freeze for Duration
impl RefUnwindSafe for Duration
impl Send for Duration
impl Sync for Duration
impl Unpin for Duration
impl UnwindSafe for Duration
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