Skip to main content

Time

Trait Time 

Source
pub trait Time:
    Send
    + Sync
    + 'static {
    // Required methods
    fn get<'life0, 'async_trait>(
        &'life0 self,
        request: Request<TimeGetRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<TimeGetResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn sleep<'life0, 'async_trait>(
        &'life0 self,
        request: Request<TimeSleepRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<TimeSleepResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Generated trait containing gRPC methods that should be implemented for use with TimeServer.

Required Methods§

Source

fn get<'life0, 'async_trait>( &'life0 self, request: Request<TimeGetRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<TimeGetResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read the authoritative host clock used by operation deadlines, retries and plugin waits.

Source

fn sleep<'life0, 'async_trait>( &'life0 self, request: Request<TimeSleepRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<TimeSleepResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Wait on the host clock for the supplied duration; virtual-time hosts advance this wait under their work/demand policy.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§