pub struct ScopeDispatcher { /* private fields */ }Expand description
Implements a C++-compatible async_dispatcher_t around a fuchsia_async::Scope.
Implementations§
Source§impl ScopeDispatcher
impl ScopeDispatcher
Sourcepub fn new() -> Arc<Self> ⓘ
pub fn new() -> Arc<Self> ⓘ
Creates a new ScopeDispatcher on the currently running fuchsia-async executor.
§Panics
Panics if this is not run on a fuchsia-async executor context.
Sourcepub fn new_on_executor(executor: EHandle) -> Arc<Self> ⓘ
pub fn new_on_executor(executor: EHandle) -> Arc<Self> ⓘ
Creates a new ScopeDispatcher with a new Scope on the given executor.
Sourcepub fn as_ptr(&self) -> *const async_dispatcher_t
pub fn as_ptr(&self) -> *const async_dispatcher_t
Get the pointer to the dispatcher callback struct for passing through FFI layers.
Sourcepub fn global_handle(&self) -> &EHandle
pub fn global_handle(&self) -> &EHandle
Gets the global executor handle for this dispatcher.
Sourcepub fn as_scope(&self) -> &Scope
pub fn as_scope(&self) -> &Scope
Gets the fuchsia_async::Scope of this dispatcher.
Sourcepub fn is_shutting_down(&self) -> bool
pub fn is_shutting_down(&self) -> bool
Returns true if the dispatcher is currently shutting down.
Sourcepub fn shutdown(&self) -> ShutdownCompletionFuture<'_> ⓘ
pub fn shutdown(&self) -> ShutdownCompletionFuture<'_> ⓘ
Starts the dispatcher shutdown. Resolves when all outstanding tasks have been completed or canceled.
Trait Implementations§
Source§impl AsAsyncDispatcherRef for ScopeDispatcher
impl AsAsyncDispatcherRef for ScopeDispatcher
Source§fn as_async_dispatcher_ref(&self) -> AsyncDispatcherRef<'_>
fn as_async_dispatcher_ref(&self) -> AsyncDispatcherRef<'_>
Gets an
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>
Schedules the callback [
p] to be run on this dispatcher later.Source§impl Debug for ScopeDispatcher
impl Debug for ScopeDispatcher
Source§impl Drop for ScopeDispatcher
impl Drop for ScopeDispatcher
impl Send for ScopeDispatcher
impl Sync for ScopeDispatcher
Auto Trait Implementations§
impl !Freeze for ScopeDispatcher
impl !RefUnwindSafe for ScopeDispatcher
impl !UnwindSafe for ScopeDispatcher
impl Unpin for ScopeDispatcher
impl UnsafeUnpin for ScopeDispatcher
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
Mutably borrows from an owned value. Read more
Source§impl<T> GetAsyncDispatcher for Twhere
T: AsAsyncDispatcherRef,
impl<T> GetAsyncDispatcher for Twhere
T: AsAsyncDispatcherRef,
Source§fn try_get_async_dispatcher(&self) -> Option<AsyncDispatcher>
fn try_get_async_dispatcher(&self) -> Option<AsyncDispatcher>
Returns a refcounted handle to the active dispatcher for this object, if there is one.
Some types of dispatchers (like for the current dispatcher of a thread) may not always have
an active dispatcher, so it is returned as an option.
Source§fn get_async_dispatcher(&self) -> AsyncDispatcher
fn get_async_dispatcher(&self) -> AsyncDispatcher
Returns a refcounted handle to the active dispatcher for this object. Read more