pub struct AsyncExecutor { /* private fields */ }Expand description
Native async executor with access to the PAL I/O reactor.
Implementations§
Source§impl AsyncExecutor
impl AsyncExecutor
Sourcepub fn new() -> Result<AsyncExecutor, Error>
pub fn new() -> Result<AsyncExecutor, Error>
Create a new native async executor with a PAL I/O reactor handle.
Sourcepub fn spawn<F, T>(&self, future: F) -> AsyncHandle<T> ⓘ
pub fn spawn<F, T>(&self, future: F) -> AsyncHandle<T> ⓘ
Spawn an async task with default priority.
Sourcepub fn spawn_with_priority<F, T>(
&self,
future: F,
priority: Priority,
) -> AsyncHandle<T> ⓘ
pub fn spawn_with_priority<F, T>( &self, future: F, priority: Priority, ) -> AsyncHandle<T> ⓘ
Spawn an async task with specified priority.
Sourcepub fn run(&self) -> Result<(), Error>
pub fn run(&self) -> Result<(), Error>
Run the native async executor and poll the PAL reactor between task passes.
Sourcepub fn stats(&self) -> ExecutorStats
pub fn stats(&self) -> ExecutorStats
Get current executor statistics.
Trait Implementations§
Source§impl Default for AsyncExecutor
impl Default for AsyncExecutor
Source§fn default() -> AsyncExecutor
fn default() -> AsyncExecutor
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for AsyncExecutor
impl !RefUnwindSafe for AsyncExecutor
impl !UnwindSafe for AsyncExecutor
impl Send for AsyncExecutor
impl Sync for AsyncExecutor
impl Unpin for AsyncExecutor
impl UnsafeUnpin for AsyncExecutor
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