Skip to main content

CheckedPolicy

Trait CheckedPolicy 

Source
pub trait CheckedPolicy: Policy {
    // Required method
    fn assert_initialized(state: &Self::State);
}
Expand description

An initialization policy that actively validates initialization state.

Required Methods§

Source

fn assert_initialized(state: &Self::State)

Asserts that the instance has been initialized.

This method is called on the hot path by crate::LazyInit::get before reading the wrapped value. Implementations should always inline and reduce to a single load, compare, and conditional branch to an out-of-line, cold panic path.

§Panics

Panics if the instance has not been initialized.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§