Trait hickory_proto::Time

source ·
pub trait Time {
    // Required methods
    fn delay_for<'async_trait>(
        duration: Duration
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>;
    fn timeout<'async_trait, F>(
        duration: Duration,
        future: F
    ) -> Pin<Box<dyn Future<Output = Result<F::Output, Error>> + Send + 'async_trait>>
       where F: 'async_trait + 'static + Future + Send;
}
Expand description

Generic Time for Delay and Timeout.

Required Methods§

source

fn delay_for<'async_trait>( duration: Duration ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>

Return a type that implements Future that will wait until the specified duration has elapsed.

source

fn timeout<'async_trait, F>( duration: Duration, future: F ) -> Pin<Box<dyn Future<Output = Result<F::Output, Error>> + Send + 'async_trait>>
where F: 'async_trait + 'static + Future + Send,

Return a type that implement Future to complete before the specified duration has elapsed.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Time for TokioTime

Available on crate feature tokio-runtime only.