[][src]Struct ticktock::clock::ClockIter

pub struct ClockIter<'a>(_);

A clock iterator

Used to iterate over the clock:

use std::time;
use ticktock::Clock;

let start = time::Instant::now();
// ticks once per second
let mut clock = Clock::new(time::Duration::from_secs(1));

// as soon as the clock starts, it will wait for the next tick.
// in this case, we'll start at t = 1 second
for tick in clock.iter() {
    // ...

    // a simple break will exit
    break;
}

let end = time::Instant::now();

assert!(time::Duration::from_secs(1) < end - start);

Trait Implementations

impl<'a> Iterator for ClockIter<'a>[src]

type Item = (u128, Instant)

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a> RefUnwindSafe for ClockIter<'a>

impl<'a> Send for ClockIter<'a>

impl<'a> Sync for ClockIter<'a>

impl<'a> Unpin for ClockIter<'a>

impl<'a> UnwindSafe for ClockIter<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.