pub struct LocalExecutor { /* private fields */ }
Expand description
A single-threaded port-based executor for Fuchsia.
Having a LocalExecutor
in scope allows the creation and polling of zircon objects, such as
[fuchsia_async::Channel
].
§Panics
LocalExecutor
will panic on drop if any zircon objects attached to it are still alive. In
other words, zircon objects backed by a LocalExecutor
must be dropped before it.
Implementations§
Source§impl LocalExecutor
impl LocalExecutor
Sourcepub fn new_with_port(port: Port) -> Self
pub fn new_with_port(port: Port) -> Self
Create a new single-threaded executor running with actual time, with a port.
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 run_singlethreaded<F>(&mut self, main_future: F) -> F::Outputwhere
F: Future,
pub fn run_singlethreaded<F>(&mut self, main_future: F) -> F::Outputwhere
F: Future,
Run a single future to completion on a single thread, also polling other active tasks.
Trait Implementations§
Source§impl Debug for LocalExecutor
impl Debug for LocalExecutor
Source§impl Default for LocalExecutor
impl Default for LocalExecutor
Auto Trait Implementations§
impl Freeze for LocalExecutor
impl !RefUnwindSafe for LocalExecutor
impl Send for LocalExecutor
impl Sync for LocalExecutor
impl Unpin for LocalExecutor
impl !UnwindSafe for LocalExecutor
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