Skip to main content

SelfTestStarted

Struct SelfTestStarted 

Source
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.

Trait Implementations§

Source§

impl Debug for SelfTestStarted

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.