pub struct AsyncTask { /* private fields */ }Expand description
A deterministic async task that resolves after a fixed number of polls.
The simplest control organ in this crate: it models the poll-to-completion surface of asynchronous behavior without a real executor, so the control-policy contracts can be exercised deterministically.
Implementations§
Source§impl AsyncTask
impl AsyncTask
Sourcepub fn ready_after(pending_polls: usize, result: Ref) -> Self
pub fn ready_after(pending_polls: usize, result: Ref) -> Self
Builds a task that reports AsyncPoll::Pending for pending_polls
polls, then yields result.
Sourcepub fn poll(&mut self) -> AsyncPoll
pub fn poll(&mut self) -> AsyncPoll
Advances the task one step, returning AsyncPoll::Pending until the
pending count is exhausted and AsyncPoll::Ready thereafter.
Trait Implementations§
impl Eq for AsyncTask
impl StructuralPartialEq for AsyncTask
Auto Trait Implementations§
impl Freeze for AsyncTask
impl RefUnwindSafe for AsyncTask
impl Send for AsyncTask
impl Sync for AsyncTask
impl Unpin for AsyncTask
impl UnsafeUnpin for AsyncTask
impl UnwindSafe for AsyncTask
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