Struct tokio_mock_task::MockTask [−][src]
pub struct MockTask { /* fields omitted */ }
Mock task
A mock task is able to intercept and track notifications.
Methods
impl MockTask
[src]
impl MockTask
pub fn new() -> Self
[src]
pub fn new() -> Self
Create a new mock task
pub fn enter<F, R>(&mut self, f: F) -> R where
F: FnOnce() -> R,
[src]
pub fn enter<F, R>(&mut self, f: F) -> R where
F: FnOnce() -> R,
Run a closure from the context of the task.
Any notifications resulting from the execution of the closure are tracked.
pub fn is_notified(&self) -> bool
[src]
pub fn is_notified(&self) -> bool
Returns true
if the inner future has received a readiness notification
since the last call to enter
.