pub struct SelfTestStarted { /* private fields */ }Expand description
Proof that require_self_test_started passed for the holder.
Zero-sized, with no public constructor and no Clone or Copy: the only
way to obtain one is require_self_test_started_token. A hidden method
that takes &SelfTestStarted lets an algorithm crate do the state check
once at its own entry point and then run a per-block or per-squeeze loop,
or a region whose instructions must not change such as the entropy
source’s timed workload, without repeating it. Each caller obtains the
token per call and never stores it. Holding a token across a transition
to Error does not matter, because the methods that accept one are
hidden and outside the module’s defined service interface.
It is Sync, so a call that checked the state on its own thread can lend
&SelfTestStarted to the worker threads it runs in parallel. A worker
calling the guard itself would be refused during SelfTest, which admits
only the thread running the power-up self-tests.