Skip to main content

PollClock

Trait PollClock 

Source
pub trait PollClock {
    // Required methods
    fn now(&self) -> Instant;
    fn sleep(&mut self, duration: Duration);
}
Expand description

Time source and sleeper for DeviceFlow::wait_for_token.

Injected so tests can run the poll loop without real waiting; production callers use SystemPollClock.

Required Methods§

Source

fn now(&self) -> Instant

The current instant.

Source

fn sleep(&mut self, duration: Duration)

Block for duration before the next poll.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§