Skip to main content

BaseGuard

Trait BaseGuard 

Source
pub trait BaseGuard {
    type State: Clone + Copy;

    // Required methods
    fn acquire() -> Self::State;
    fn release(state: Self::State);
}
Expand description

A base trait that all guards implement.

Required Associated Types§

Source

type State: Clone + Copy

The saved state when entering the critical section.

Required Methods§

Source

fn acquire() -> Self::State

Something that must be done before entering the critical section.

Source

fn release(state: Self::State)

Something that must be done after leaving the critical section.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§