API Reference
The guide and the rustdoc split the work: the guide explains why and
when to reach for an API; the rustdoc carries signatures, field
semantics, and edge cases. The complete rustdoc for every ktstr
workspace crate is published at
ktstr.dev/rustdoc/ktstr, and
ktstr::prelude
re-exports everything a test author needs.
| You want to | Reach for | Rustdoc | Guide chapter |
|---|---|---|---|
| Declare a test | #[ktstr_test] | attr.ktstr_test | The #[ktstr_test] Attribute |
| Declare a scheduler | declare_scheduler!, Scheduler, SchedulerSpec | macro.declare_scheduler, test_support | Scheduler Definitions |
| Drive a scenario | Ctx, scenarios::* | scenario | Scenarios, Custom Scenarios |
| Compose steps and ops | Step, Op, HoldSpec, Backdrop | scenario::ops | Ops, Steps, and Backdrop |
| Shape cgroups and cpusets | CgroupDef, CpusetSpec | scenario::ops | Topology |
| Check results | Assert, AssertResult, Verdict, claim! | assert | Checking, Customize Checking |
| Gate performance regressions | PerfDeltaAssertion | test_support | Assertable Metrics |
| Generate load | WorkType, WorkloadConfig, WorkloadHandle | workload | Work Types, Workers and Workloads |
| Run guest binaries | #[derive(Payload)], Payload | derive.Payload | Payloads and Included Files |
| Capture guest state | Snapshot, SnapshotBridge, Sample, SampleSeries | scenario::snapshot, scenario::sample | Snapshots, Temporal Assertions |
The #[ktstr_test] attribute’s arguments (topology dimensions,
thresholds, execution flags) are documented in the
macro reference chapter and on
the attribute’s own
rustdoc page;
the macro itself lives in the ktstr-macros crate and is re-exported
at the crate root.