pub struct Executor<E: Environment> { /* private fields */ }
Implementations§
Source§impl<E: Environment> Executor<E>
impl<E: Environment> Executor<E>
pub fn new<F: FnOnce(&Handle) -> E>(create_env: F) -> Self
Sourcepub fn set_max_self_wakes(&mut self, max: Option<usize>)
pub fn set_max_self_wakes(&mut self, max: Option<usize>)
Sets the maximum number of times that a task can wake itself up after polling
pub fn spawn<F, Output>(&self, future: F) -> JoinHandle<Output> ⓘ
pub fn handle(&self) -> &Handle
pub fn microstep(&mut self) -> usize
pub fn macrostep(&mut self) -> Macrostep
pub fn block_on<T, Output>(&mut self, task: T) -> Output
pub fn block_on_primary(&mut self)
pub fn environment(&mut self) -> &mut E
pub fn close(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl<E> Freeze for Executor<E>where
E: Freeze,
impl<E> !RefUnwindSafe for Executor<E>
impl<E> Send for Executor<E>where
E: Send,
impl<E> !Sync for Executor<E>
impl<E> Unpin for Executor<E>where
E: Unpin,
impl<E> !UnwindSafe for Executor<E>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more