Skip to main content

Module core

Module core 

Source

Modules§

args
bench
desert_rust
internal
spawn
worker
Worker-process metadata exposed to user-defined dependency factories.

Structs§

CloneableCodec
Function-pointer wrappers used by Cloneable deps to convert the constructed value into wire bytes on the parent, and to deserialize those bytes into a typed value on the worker.
DynamicTestRegistration
GeneratedTest
HostedBothShared
Support type for #[test_dep(scope = Hosted, worker = both(T))].
HostedRpcChannel
Per-dep channel handed to HostedRpcDep::build_stub on the worker side.
HostedRpcOwnerCell
Type-erased, parent-owned cell that holds the owner value behind a Mutex and exposes a &self dispatch entry point. Constructed by the macro-generated registration code on the parent (the DependencyConstructor for a HostedRpc dep returns one of these wrapped in Arc<dyn Any>) and kept alive in _hosted_owners for the suite’s lifetime.
InProcessHostedRpcTransport
In-process transport used in --nocapture / single-process mode: the stub calls the owner-side HostedRpcOwnerCell directly without touching any IPC stream.
RpcFactory
Factory pair stored on a HostedRpc RegisteredDependency. The macro emits a RpcFactory per registered HostedRpc dep so the runtime can (a) wrap the constructor’s output into a parent dispatcher cell, and (b) build a worker-side stub from a channel.
TestProperties

Enums§

CaptureControl
DepScope
Sharing strategy declared on a #[test_dep]. Controls how the dependency interacts with output capturing and parallel test execution.
DependencyConstructor
DetachedPanicPolicy
FailureCause
FlakinessControl
HostedRpcError
Error returned by HostedRpcChannel::call when an RPC fails.
ReportTimeControl
ShouldPanic
TestFunction
TestGeneratorFunction
TestType
WorkerReconstructor
Function pointer-equivalent used by the worker side of a Cloneable dependency. Receives the deserialized wire payload (boxed as Any for type erasure) plus the current dependency view, and produces the reconstructed worker-side value.

Traits§

AsyncHostedDep
Async counterpart of HostedDep. Implement this when worker-side reconstruction needs to .await (e.g. opening async network clients, doing async filesystem work, calling Provided*::new(...).await constructors).
CloneableDep
User-facing trait that opts a dependency value into the Cloneable sharing strategy. The parent calls to_wire once and ships the bytes to each worker via IPC. Each worker calls from_wire to reconstruct a local value.
DependencyView
HostedDep
User-facing trait that opts a dependency value into the Hosted sharing strategy. Like CloneableDep, but the owner instance lives in the parent test runner process for the entire suite. The parent runs the constructor once per Hosted dep and keeps the value alive until every worker has finished — useful for singleton services like an in-process TCP listener, a Docker container, an env-based test environment, or any long-running runtime that must not be duplicated across worker processes.
HostedRpcDep
User-facing trait that opts a dependency value into the HostedRpc sharing strategy. Like HostedDep, the owner lives in the parent test runner process for the entire suite; unlike Hosted, workers do NOT see the owner type — they see a separate Stub type that calls back into the parent over the existing IPC socket through a small generated method-dispatch table.
HostedRpcDispatcher
Dyn-safe entry point used by the parent runtime to dispatch incoming [crate::ipc::IpcResponse::HostedRpcCall] frames to a type-erased owner value. Auto-implemented for every HostedRpcDep.
HostedRpcTransport
Trait implemented by the per-runner transport that workers use to send RPCs to the parent’s owner. The runtime provides a concrete IPC implementation for the spawn-workers case and a direct in-process implementation for --nocapture / single-process mode.
TestReturnValue

Functions§

register_dependency_constructor
register_dependency_constructor_with_scope
register_dependency_constructor_with_scope_and_companions
Registers a dependency constructor that must be retained together with the listed companions during pruning. See internal::RegisteredDependency::companions for the planner semantics. All other parameters behave exactly as register_dependency_constructor_with_scope.
register_suite_sequential
register_suite_tag
register_suite_timeout
register_test
register_test_generator
test_runner
worker_index
Returns the zero-based worker index assigned to this OS process.