Skip to main content

ScopeDispatcher

Struct ScopeDispatcher 

Source
pub struct ScopeDispatcher { /* private fields */ }
Expand description

Implements a C++-compatible async_dispatcher_t around a fuchsia_async::Scope.

Implementations§

Source§

impl ScopeDispatcher

Source

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.

Source

pub fn new_on_executor(executor: EHandle) -> Arc<Self>

Creates a new ScopeDispatcher with a new Scope on the given executor.

Source

pub fn as_ptr(&self) -> *const async_dispatcher_t

Get the pointer to the dispatcher callback struct for passing through FFI layers.

Source

pub fn global_handle(&self) -> &EHandle

Gets the global executor handle for this dispatcher.

Source

pub fn as_scope(&self) -> &Scope

Gets the fuchsia_async::Scope of this dispatcher.

Source

pub fn is_shutting_down(&self) -> bool

Returns true if the dispatcher is currently shutting down.

Source

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

Source§

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>

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

impl Debug for ScopeDispatcher

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for ScopeDispatcher

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Send for ScopeDispatcher

Source§

impl Sync for ScopeDispatcher

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> GetAsyncDispatcher for T

Source§

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

Returns a refcounted handle to the active dispatcher for this object. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.