Struct fuchsia_async::EHandle
source · pub struct EHandle { /* private fields */ }
Expand description
A handle to an executor.
Implementations§
source§impl EHandle
impl EHandle
sourcepub fn local() -> Self
pub fn local() -> Self
Returns the thread-local executor.
§Panics
If called outside the context of an active async executor.
sourcepub fn root_scope(&self) -> &ScopeRef
pub fn root_scope(&self) -> &ScopeRef
The root scope of the executor.
This can be used to spawn tasks that live as long as the executor, and to create shorter-lived child scopes.
sourcepub fn port(&self) -> &Port
pub fn port(&self) -> &Port
Get a reference to the Fuchsia zx::Port
being used to listen for events.
sourcepub fn register_receiver<T>(&self, receiver: Arc<T>) -> ReceiverRegistration<T>where
T: PacketReceiver,
pub fn register_receiver<T>(&self, receiver: Arc<T>) -> ReceiverRegistration<T>where
T: PacketReceiver,
Registers a PacketReceiver
with the executor and returns a registration.
The PacketReceiver
will be deregistered when the Registration
is dropped.
sourcepub fn spawn_detached(&self, future: impl Future<Output = ()> + Send + 'static)
pub fn spawn_detached(&self, future: impl Future<Output = ()> + Send + 'static)
Spawn a new task to be run on this executor.
Tasks spawned using this method must be thread-safe (implement the Send
trait), as they
may be run on either a singlethreaded or multithreaded executor.
sourcepub fn spawn_local_detached(&self, future: impl Future<Output = ()> + 'static)
pub fn spawn_local_detached(&self, future: impl Future<Output = ()> + 'static)
Spawn a new task to be run on this executor.
This is similar to the spawn_detached
method, but tasks spawned using this method do not
have to be threads-safe (implement the Send
trait). In return, this method requires that
this executor is a LocalExecutor.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EHandle
impl !RefUnwindSafe for EHandle
impl Send for EHandle
impl Sync for EHandle
impl Unpin for EHandle
impl !UnwindSafe for EHandle
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)