Skip to main content

Guardian

Trait Guardian 

Source
pub trait Guardian: Sealed {
    type Token;

    // Required methods
    fn enter() -> GuardianState<Self::Token>;
    fn exit(state: GuardianState<Self::Token>);
}
Expand description

Determines how interrupts / preemption are handled while a SpinLock is held.

Required Associated Types§

Source

type Token

Token type that proves the CPU is in the right protection mode.

Required Methods§

Source

fn enter() -> GuardianState<Self::Token>

Enter the protected mode and return the token.

Source

fn exit(state: GuardianState<Self::Token>)

Exit the protected mode, restoring the previous CPU state.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§