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 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 !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
Mutably borrows from an owned value. Read more