Skip to main content

Module task

Module task 

Source
Expand description

Executor for running tests with mocked environment

See MockExecutor

Re-exportsΒ§

use std::any::Any; πŸ”’
use std::cell::Cell; πŸ”’
use std::collections::VecDeque; πŸ”’
use std::fmt; πŸ”’
use std::fmt::Debug; πŸ”’
use std::fmt::Debug; πŸ”’
use std::fmt::Display; πŸ”’
use std::future::Future; πŸ”’
use std::io; πŸ”’
use std::io::Write as _; πŸ”’
use std::iter; πŸ”’
use std::panic::AssertUnwindSafe; πŸ”’
use std::panic::catch_unwind; πŸ”’
use std::panic::panic_any; πŸ”’
use std::pin::Pin; πŸ”’
use std::pin::pin; πŸ”’
use std::sync::Arc; πŸ”’
use std::sync::Mutex; πŸ”’
use std::sync::MutexGuard; πŸ”’
use std::sync::Weak; πŸ”’
use std::task::Context; πŸ”’
use std::task::Poll; πŸ”’
use std::task::RawWaker; πŸ”’
use std::task::RawWakerVTable; πŸ”’
use std::task::Waker; πŸ”’
use futures::FutureExt as _; πŸ”’
use futures::pin_mut; πŸ”’
use futures::task::FutureObj; πŸ”’
use futures::task::Spawn; πŸ”’
use futures::task::SpawnError; πŸ”’
use assert_matches::assert_matches; πŸ”’
use educe::Educe; πŸ”’
use itertools::Either; πŸ”’
use itertools::chain; πŸ”’
use itertools::chain; πŸ”’
use itertools::izip; πŸ”’
use slotmap_careful::DenseSlotMap; πŸ”’
use std::backtrace::Backtrace; πŸ”’
use strum::EnumIter; πŸ”’
use tracing::error; πŸ”’
use tracing::trace; πŸ”’
use oneshot_fused_workaround as oneshot; πŸ”’
use oneshot_fused_workaround::Canceled; πŸ”’
use tor_error::error_report; πŸ”’
use tor_rtcompat::join_set::FuturesJoinSet; πŸ”’
use tor_rtcompat::Blocking; πŸ”’
use tor_rtcompat::JoinSetProvider; πŸ”’
use tor_rtcompat::ToplevelBlockOn; πŸ”’
use task_id::Ti as TaskId; πŸ”’
use itertools::Either::*; πŸ”’
use Poll::*; πŸ”’
use TaskState::*; πŸ”’

ModulesΒ§

task_id πŸ”’
Task id, module to hide Ti alias

StructsΒ§

ActualWaker πŸ”’
Actual implementor of Wake for use in a Waker
Data πŸ”’
Executor’s state
DebugDump
Debugging dump of a MockExecutor’s state
DebugTasks πŸ”’
Helper: Debugs as a list of tasks, given the Data for lookups and a list of the ids
IsSubthread πŸ”’
Marker indicating that this task is a Subthread, not an async task.
MockExecutor
Executor for running tests with mocked environment
ProgressUntilStalledFuture πŸ”’
Future from progress_until_stalled
ProgressingUntilStalled πŸ”’
State used for an in-progress call to progress_until_stalled
SchedulingPolicyIter
An iterator over the variants of SchedulingPolicy
SetAwake πŸ”’
Shared::subthread_yield should set our task awake before switching to the executor
Shared πŸ”’
Shared state and ancillary information
Task πŸ”’
Record of a single task

EnumsΒ§

SchedulingPolicy
How we should schedule?
TaskFutureInfo πŸ”’
A future as stored in our record of a Task
TaskState πŸ”’
State of a task - do we think it needs to be polled?
ThreadDescriptor πŸ”’
Identifies a thread we know about - the executor thread, or a Subthread

ConstantsΒ§

THREAD_DESCRIPTOR
Identifies this thread.

StaticsΒ§

RAW_WAKER_VTABLE πŸ”’
vtable for Box<ActualWaker> as RawWaker

TraitsΒ§

EnsureSyncSend πŸ”’
Trait to let us assert at compile time that something is nicely Sync etc.

Type AliasesΒ§

MainFuture πŸ”’
Future for the argument to block_on, which is handled specially
SleepLocation πŸ”’
We record β€œwhere a future went to sleep” as (just) a backtrace
TaskFuture πŸ”’
Type-erased future, one for each of our (normal) tasks