pub struct RestoreState(_);
Expand description

Opaque “restore state”.

Implementations use this to “carry over” information between acquiring and releasing a critical section. For example, when nesting two critical sections of an implementation that disables interrupts globally, acquiring the inner one won’t disable the interrupts since they’re already disabled. The impl would use the restore state to “tell” the corresponding release that it does not have to reenable interrupts yet, only the outer release should do so.

User code uses RestoreState opaquely, critical section implementations use RawRestoreState so that they can use the inner value.

Implementations

Create an invalid, dummy RestoreState.

This can be useful to avoid Option when storing a RestoreState in a struct field, or a static.

Note that due to the safety contract of acquire/release, you must not pass a RestoreState obtained from this method to release.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.