pub struct Delay { /* private fields */ }
Expand description
The delay of a frame relative to the previous one.
Implementations
sourceimpl Delay
impl Delay
sourcepub fn from_numer_denom_ms(numerator: u32, denominator: u32) -> Self
pub fn from_numer_denom_ms(numerator: u32, denominator: u32) -> Self
Create a delay from a ratio of milliseconds.
Examples
use image::Delay;
let delay_10ms = Delay::from_numer_denom_ms(10, 1);
sourcepub fn from_saturating_duration(duration: Duration) -> Self
pub fn from_saturating_duration(duration: Duration) -> Self
Convert from a duration, clamped between 0 and an implemented defined maximum.
The maximum is at least i32::MAX
milliseconds. It should be noted that the accuracy of
the result may be relative and very large delays have a coarse resolution.
Examples
use std::time::Duration;
use image::Delay;
let duration = Duration::from_millis(20);
let delay = Delay::from_saturating_duration(duration);
Trait Implementations
sourceimpl PartialOrd<Delay> for Delay
impl PartialOrd<Delay> for Delay
sourcefn partial_cmp(&self, other: &Delay) -> Option<Ordering>
fn partial_cmp(&self, other: &Delay) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for Delay
impl Eq for Delay
impl StructuralEq for Delay
impl StructuralPartialEq for Delay
Auto Trait Implementations
impl RefUnwindSafe for Delay
impl Send for Delay
impl Sync for Delay
impl Unpin for Delay
impl UnwindSafe for Delay
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more