AsyncDispatcher

Trait AsyncDispatcher 

Source
pub trait AsyncDispatcher: Send + Sync {
    // Required method
    fn as_async_dispatcher_ref(&self) -> AsyncDispatcherRef<'_>;

    // Provided methods
    fn post_task_sync(&self, p: impl TaskCallback) -> Result<(), Status> { ... }
    fn now(&self) -> Instant<MonotonicTimeline> { ... }
}
Expand description

A trait for things that can be represented as an AsyncDispatcherRef.

Required Methods§

Source

fn as_async_dispatcher_ref(&self) -> AsyncDispatcherRef<'_>

Gets an AsyncDispatcherRef corresponding to this object.

Provided Methods§

Source

fn post_task_sync(&self, p: impl TaskCallback) -> Result<(), Status>

Schedules the callback [p] to be run on this dispatcher later.

Source

fn now(&self) -> Instant<MonotonicTimeline>

Returns the current time on the dispatcher’s timeline

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§