Trait AsyncDispatcher
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§
fn as_async_dispatcher_ref(&self) -> AsyncDispatcherRef<'_>
fn as_async_dispatcher_ref(&self) -> AsyncDispatcherRef<'_>
Gets an AsyncDispatcherRef corresponding to this object.
Provided Methods§
fn post_task_sync(&self, p: impl TaskCallback) -> Result<(), Status>
fn post_task_sync(&self, p: impl TaskCallback) -> Result<(), Status>
Schedules the callback [p] to be run on this dispatcher later.
fn now(&self) -> Instant<MonotonicTimeline>
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.