Struct gjio::Timer [] [src]

pub struct Timer {
    // some fields omitted
}

Allows scheduling of timeouts.

Methods

impl Timer
[src]

fn after_delay(&self, delay: Duration) -> Promise<()Error>

Returns a promise that will be fulfilled after the given delay.

fn timeout_after<T>(&self, delay: Duration, promise: Promise<T, Error>) -> Promise<T, Error>

Wraps the given promise in a timeout. If the original promise is not completed within that time, it is cancelled.