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>) -> Dispatcher
pub unsafe fn from_raw(handle: NonNull<fdf_dispatcher>) -> Dispatcher
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 allows_thread_migration(&self) -> bool
pub fn allows_thread_migration(&self) -> bool
Whether this dispatcher is allowed to migrate threads, in which case it can’t
be used for non-Send tasks.
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) -> AutoReleaseDispatcher
pub fn release(self) -> AutoReleaseDispatcher
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) -> DriverDispatcherRef<'_>
pub fn as_dispatcher_ref(&self) -> DriverDispatcherRef<'_>
Returns a [DispatcherRef] that references this dispatcher with a lifetime constrained by
self.
Trait Implementations§
Source§impl AsAsyncDispatcherRef for Dispatcher
impl AsAsyncDispatcherRef for Dispatcher
Source§fn as_async_dispatcher_ref(&self) -> AsyncDispatcherRef<'_>
fn as_async_dispatcher_ref(&self) -> AsyncDispatcherRef<'_>
AsyncDispatcherRef corresponding to this object.§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.Source§impl Debug for Dispatcher
impl Debug for Dispatcher
Source§impl Drop for Dispatcher
impl Drop for Dispatcher
Source§impl From<Dispatcher> for AutoReleaseDispatcher
impl From<Dispatcher> for AutoReleaseDispatcher
Source§fn from(dispatcher: Dispatcher) -> AutoReleaseDispatcher
fn from(dispatcher: Dispatcher) -> AutoReleaseDispatcher
impl Send for Dispatcher
impl Sync for Dispatcher
Auto Trait Implementations§
impl Freeze for Dispatcher
impl RefUnwindSafe for Dispatcher
impl Unpin for Dispatcher
impl UnsafeUnpin for Dispatcher
impl UnwindSafe for Dispatcher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> DispatcherSignalExt for Twhere
T: GetAsyncDispatcher,
impl<T> DispatcherSignalExt for Twhere
T: GetAsyncDispatcher,
Source§fn on_signals<H>(&self, handle: H, signals: Signals) -> OnSignals<H>where
H: AsHandleRef,
fn on_signals<H>(&self, handle: H, signals: Signals) -> OnSignals<H>where
H: AsHandleRef,
Source§fn try_on_signals<H>(&self, handle: H, signals: Signals) -> Option<OnSignals<H>>where
H: AsHandleRef,
fn try_on_signals<H>(&self, handle: H, signals: Signals) -> Option<OnSignals<H>>where
H: AsHandleRef,
None if there is no dispatcher found on self.