pub struct Dispatcher(/* private fields */);Expand description
An owned handle for a dispatcher managed by the driver runtime.
Implementations§
Source§impl Dispatcher
impl Dispatcher
Sourcepub unsafe fn from_raw(handle: NonNull<fdf_dispatcher_t>) -> Self
pub unsafe fn from_raw(handle: NonNull<fdf_dispatcher_t>) -> Self
Creates a dispatcher ref from a raw handle.
§Safety
Caller is responsible for ensuring that the given handle is valid and not owned by any other wrapper that will free it at an arbitrary time.
Sourcepub fn is_unsynchronized(&self) -> bool
pub fn is_unsynchronized(&self) -> bool
Whether this dispatcher’s tasks and futures can run on multiple threads at the same time.
Sourcepub fn allows_thread_blocking(&self) -> bool
pub fn allows_thread_blocking(&self) -> bool
Whether this dispatcher is allowed to call blocking functions or not
Sourcepub fn is_current_dispatcher(&self) -> bool
pub fn is_current_dispatcher(&self) -> bool
Whether this is the dispatcher the current thread is running on
Sourcepub fn release(self) -> DispatcherRef<'static>
pub fn release(self) -> DispatcherRef<'static>
Releases ownership over this dispatcher and returns a DispatcherRef
that can be used to access it. The lifetime of this reference is static because it will
exist so long as this current driver is loaded, but the driver runtime will shut it down
when the driver is unloaded.
Sourcepub fn as_dispatcher_ref(&self) -> DispatcherRef<'_>
pub fn as_dispatcher_ref(&self) -> DispatcherRef<'_>
Returns a DispatcherRef that references this dispatcher with a lifetime constrained by
self.
Trait Implementations§
Source§impl AsyncDispatcher for Dispatcher
impl AsyncDispatcher for Dispatcher
Source§fn as_async_dispatcher_ref(&self) -> AsyncDispatcherRef<'_>
fn as_async_dispatcher_ref(&self) -> AsyncDispatcherRef<'_>
AsyncDispatcherRef corresponding to this object.Source§fn post_task_sync(&self, p: impl TaskCallback) -> Result<(), Status>
fn post_task_sync(&self, p: impl TaskCallback) -> Result<(), Status>
p] to be run on this dispatcher later.